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

Commit 067144f4 authored by jiangxiulong's avatar jiangxiulong

Merge branch 'dev' into test

parents 26b41727 05735f8b
...@@ -13,4 +13,5 @@ public class KylinStationUploadParam implements Serializable { ...@@ -13,4 +13,5 @@ public class KylinStationUploadParam implements Serializable {
private static final long serialVersionUID = -44725043769303036L; private static final long serialVersionUID = -44725043769303036L;
@ApiModelProperty(position = 10, value = "票明细数据") @ApiModelProperty(position = 10, value = "票明细数据")
List<KylinStationCheckOrderParam> checkOrderParamList; List<KylinStationCheckOrderParam> checkOrderParamList;
String checkClient;
} }
...@@ -2,6 +2,8 @@ package com.liquidnet.service.kylin.dto.param; ...@@ -2,6 +2,8 @@ package com.liquidnet.service.kylin.dto.param;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
public class PerformanceExpressSearchAdminParam { public class PerformanceExpressSearchAdminParam {
...@@ -24,4 +26,6 @@ public class PerformanceExpressSearchAdminParam { ...@@ -24,4 +26,6 @@ public class PerformanceExpressSearchAdminParam {
private String expressContacts; private String expressContacts;
private String expressPhone; private String expressPhone;
private List<String> ids;
} }
...@@ -30,6 +30,9 @@ public class PerformanceStep2Param implements Serializable { ...@@ -30,6 +30,9 @@ public class PerformanceStep2Param implements Serializable {
@ApiModelProperty(hidden = true) @ApiModelProperty(hidden = true)
private Integer auditStatus; private Integer auditStatus;
@ApiModelProperty(hidden = true)
private Integer status;
@ApiModelProperty(value = "场次数据",hidden = true) @ApiModelProperty(value = "场次数据",hidden = true)
private List<TicketTimesTicketCreatePartnerVo> ticketTimes; private List<TicketTimesTicketCreatePartnerVo> ticketTimes;
} }
package com.liquidnet.service.kylin.dto.vo.mongo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@ApiModel
@Data
public class KylinOrderRefundEntitiesVo {
private Integer mid;
private String orderRefundsEntities_id;
private String orderRefundsId;
private String orderTicketEntitiesId;
private BigDecimal refundPrice;
private LocalDateTime created_at;
private LocalDateTime updated_at;
}
package com.liquidnet.service.kylin.dto.vo.mongo;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Data
public class KylinOrderRefundsVo {
private Integer mid;
private String order_refunds_id;
private String order_tickets_id;
private String order_refund_code;
private String order_refund_batches_id;
private String refund_code;
private LocalDateTime refund_at;
private String refund_id;
private String refund_error;
private BigDecimal price;
private BigDecimal price_express;
private Integer status;
private Integer type;
private String applicant_id;
private String applicant_name;
private LocalDateTime applicant_at;
private String reason;
private String auditor_id;
private String auditor_name;
private LocalDateTime auditor_at;
private String reject;
private String executor_id;
private String executor_name;
private LocalDateTime executor_at;
private String refuse;
private Integer refund_type;
private String refund_cate;
private LocalDateTime created_at;
private LocalDateTime updated_at;
}
package com.liquidnet.service.kylin.dto.vo.returns; package com.liquidnet.service.kylin.dto.vo.returns;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo; import com.liquidnet.service.kylin.dto.vo.middle.KylinTicketTimesVo;
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;
...@@ -39,6 +39,8 @@ public class KylinStationPerformanceVo implements Serializable, Cloneable { ...@@ -39,6 +39,8 @@ public class KylinStationPerformanceVo implements Serializable, Cloneable {
private Integer checkedNum; private Integer checkedNum;
@ApiModelProperty(position = 23, value = "余量[9]") @ApiModelProperty(position = 23, value = "余量[9]")
private Integer remainderNum; private Integer remainderNum;
@ApiModelProperty(position = 30, value = "#过程数据,前端无需关注")
private List<KylinTicketTimesVo> ticketTimeList;
private static final KylinStationPerformanceVo obj = new KylinStationPerformanceVo(); private static final KylinStationPerformanceVo obj = new KylinStationPerformanceVo();
...@@ -49,14 +51,4 @@ public class KylinStationPerformanceVo implements Serializable, Cloneable { ...@@ -49,14 +51,4 @@ public class KylinStationPerformanceVo implements Serializable, Cloneable {
return new KylinStationPerformanceVo(); return new KylinStationPerformanceVo();
} }
} }
public KylinStationPerformanceVo copy(KylinPerformanceVo source) {
if (null == source) return this;
this.performancesId = source.getPerformancesId();
this.type = source.getType();
this.title = source.getTitle();
this.timeStart = source.getTimeStart();
this.timeEnd = source.getTimeEnd();
return this;
}
} }
package com.liquidnet.service.kylin.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.liquidnet.service.kylin.entity.KylinOrderExpress;
/**
* <p>
* 订单快递 服务类
* </p>
*
* @author jiangxiulong
* @since 2021-05-02
*/
public interface IKylinOrderExpress extends IService<KylinOrderExpress> {
}
package com.liquidnet.service.kylin.service; package com.liquidnet.service.kylin.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.liquidnet.service.kylin.dto.param.KylinStationCheckOrderParam; import com.liquidnet.service.kylin.dto.param.KylinStationUploadParam;
import com.liquidnet.service.kylin.entity.KylinOrderTicketEntities; import com.liquidnet.service.kylin.entity.KylinOrderTicketEntities;
import java.util.List;
/** /**
* <p> * <p>
* 订单详情 服务类 * 订单详情 服务类
...@@ -16,5 +14,5 @@ import java.util.List; ...@@ -16,5 +14,5 @@ import java.util.List;
*/ */
public interface IKylinOrderTicketEntitiesService extends IService<KylinOrderTicketEntities> { public interface IKylinOrderTicketEntitiesService extends IService<KylinOrderTicketEntities> {
void updateByStation(List<KylinStationCheckOrderParam> checkOrderParamList); void updateByStation(KylinStationUploadParam parameter);
} }
package com.liquidnet.client.admin.web.controller.zhengzai.kylin; package com.liquidnet.client.admin.web.controller.zhengzai.kylin;
import com.liquidnet.client.admin.common.core.controller.BaseController; import com.liquidnet.client.admin.common.core.controller.BaseController;
import com.liquidnet.client.admin.common.core.domain.AjaxResult;
import com.liquidnet.client.admin.common.core.page.TableDataInfo; import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.zhengzai.kylin.service.impl.PerformancesExpressServiceImpl; import com.liquidnet.client.admin.zhengzai.kylin.service.impl.PerformancesExpressServiceImpl;
import com.liquidnet.client.admin.zhengzai.kylin.utils.ShunfengSignUtils; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dao.PerformanceExpressPerformanceListAdminDao; import com.liquidnet.service.kylin.dao.PerformanceExpressPerformanceListAdminDao;
import com.liquidnet.service.kylin.dao.PerformanceExpressPerformanceOrderListAdminDao; import com.liquidnet.service.kylin.dao.PerformanceExpressPerformanceOrderListAdminDao;
import com.liquidnet.service.kylin.dto.param.PerformanceExpressSearchAdminParam; import com.liquidnet.service.kylin.dto.param.PerformanceExpressSearchAdminParam;
...@@ -40,8 +41,6 @@ public class PerformancesExpressController extends BaseController { ...@@ -40,8 +41,6 @@ public class PerformancesExpressController extends BaseController {
@Autowired @Autowired
private PerformancesExpressServiceImpl performancesExpressServiceImpl; private PerformancesExpressServiceImpl performancesExpressServiceImpl;
private ShunfengSignUtils shunfengSignUtils;
/** /**
* 查询演出列表 * 查询演出列表
*/ */
...@@ -83,17 +82,17 @@ public class PerformancesExpressController extends BaseController { ...@@ -83,17 +82,17 @@ public class PerformancesExpressController extends BaseController {
@RequiresPermissions("kylin:performancesExpress:placeOrder") @RequiresPermissions("kylin:performancesExpress:placeOrder")
@PostMapping("/placeOrder") @PostMapping("/placeOrder")
@ResponseBody @ResponseBody
public boolean placeOrder() { public AjaxResult placeOrder(PerformanceExpressSearchAdminParam performanceExpressSearchAdminParam) {
// 请求body companyId参数值和APPID一致!!! ResponseDto res = performancesExpressServiceImpl.placeOrder(performanceExpressSearchAdminParam);
String body="{\"dContact\":\"王昆\",\"companyId\":{{APP_ID}},\"jContact\":\"顺丰\",\"jTel\":\"111\",\"jMobile\":null,\"jAddress\":\"马甸\",\"dTel\":\"064756935\",\"dMobile\":null,\"dAddress\":\"北京市朝阳区花家地金兴路1号院5号楼1单元202\",\"custid\":\"7551234567\",\"payMethod\":\"0\",\"expressType\":\"1\",\"packagesNo\":\"1\",\"depositumInfo\":\"TCL空调\",\"depositumNo\":\"1\",\"remark\":null,\"isCollection\":\"1\",\"collectionMoney\":\"10.00\",\"isReceipt\":\"0\",\"receipt\":null}"; try {
// 时间戳 if (res.isSuccess()) {
long currentTimeMillis = System.currentTimeMillis(); return success();
System.out.println("时间戳:"+currentTimeMillis); } else {
return error(res.getMessage());
// 生成签名并请求 }
String result = shunfengSignUtils.generateSignatureAndRequest(currentTimeMillis + "", body, "/order/v1/placeOrder"); } catch (Exception e) {
System.out.println("响应:"+result); return error(e.getMessage());
return true; }
} }
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration> <configuration>
<!-- 设置路径--> <springProfile name="dev">
<springProperty scope="context" name="logPath" source="liquidnet.logfile.path"/> <property name="log.path" value="./data/logs/client-admin-web" />
</springProfile>
<springProfile name="test,prod">
<property name="log.path" value="/data/logs/client-admin-web" />
</springProfile>
<!-- 日志存放路径 -->
<property name="log.path" value="${logPath}/client-admin-web" />
<!-- 日志输出格式 --> <!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
......
...@@ -68,6 +68,8 @@ ...@@ -68,6 +68,8 @@
</div> </div>
<th:block th:include="include :: footer"/> <th:block th:include="include :: footer"/>
<script th:inline="javascript"> <script th:inline="javascript">
var placeOrderFlag = [[${@permission.hasPermi('kylin:performancesExpress:placeOrder')}]];
var prefix = ctx + "kylin/performancesExpress"; var prefix = ctx + "kylin/performancesExpress";
var orderStatusDic = [[${@dict.getType('zhengzai_order_status')}]]; var orderStatusDic = [[${@dict.getType('zhengzai_order_status')}]];
...@@ -76,6 +78,7 @@ ...@@ -76,6 +78,7 @@
var options = { var options = {
url: prefix + "/performanceOrderList", url: prefix + "/performanceOrderList",
modalName: "演出订单", modalName: "演出订单",
placeOrderUrl: prefix + "/placeOrder",
columns: [{ columns: [{
checkbox: true checkbox: true
}, },
...@@ -121,7 +124,6 @@ ...@@ -121,7 +124,6 @@
field: '', field: '',
title: '收获用户', title: '收获用户',
formatter: function(value, row, index) { formatter: function(value, row, index) {
console.log(row)
var expressContacts = row.expressContacts; var expressContacts = row.expressContacts;
var expressAddress = row.expressAddress; var expressAddress = row.expressAddress;
var expressPhone = row.expressPhone; var expressPhone = row.expressPhone;
...@@ -133,7 +135,7 @@ ...@@ -133,7 +135,7 @@
align: 'center', align: 'center',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var actions = []; var actions = [];
// actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.orderTicketsId + '\')"><i class="fa fa-search"></i>详细</a>'); actions.push('<a class="btn btn-danger btn-xs ' + placeOrderFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.orderTicketsId + '\', \'确定下单吗?\', table.options.placeOrderUrl)"></i>下单</a> ');
return actions.join(''); return actions.join('');
} }
}] }]
......
...@@ -89,6 +89,9 @@ public class KylinRefundsStatusServiceImpl { ...@@ -89,6 +89,9 @@ public class KylinRefundsStatusServiceImpl {
double RefundPriceExpress, double RefundPriceExpress,
List<String> ticketEntityIds, List<Double> entitiesPrice List<String> ticketEntityIds, List<Double> entitiesPrice
) { ) {
if (CollectionUtil.isEmpty(ticketEntityIds)) {
return false;
}
// 基础数据 // 基础数据
String authId = ShiroUtils.getUserId().toString(); String authId = ShiroUtils.getUserId().toString();
String authName = ShiroUtils.getLoginName(); String authName = ShiroUtils.getLoginName();
......
package com.liquidnet.client.admin.zhengzai.kylin.service.impl; package com.liquidnet.client.admin.zhengzai.kylin.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.client.admin.zhengzai.kylin.utils.ShunfengSignUtils;
import com.liquidnet.commons.lang.util.BeanUtil; import com.liquidnet.commons.lang.util.BeanUtil;
import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dao.*; import com.liquidnet.service.kylin.dao.*;
import com.liquidnet.service.kylin.dto.param.*; import com.liquidnet.service.kylin.dto.param.*;
import com.liquidnet.service.kylin.entity.*; import com.liquidnet.service.kylin.entity.*;
import com.liquidnet.service.kylin.mapper.*; import com.liquidnet.service.kylin.mapper.*;
import com.liquidnet.service.kylin.service.IKylinOrderExpress;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -25,16 +34,23 @@ import java.util.Map; ...@@ -25,16 +34,23 @@ import java.util.Map;
*/ */
@Service @Service
@Slf4j @Slf4j
public class PerformancesExpressServiceImpl extends ServiceImpl<KylinPerformancesMapper, KylinPerformances> { public class PerformancesExpressServiceImpl extends ServiceImpl<KylinOrderExpressMapper, KylinOrderExpress> implements IKylinOrderExpress {
@Autowired @Autowired
MongoTemplate mongoTemplate; MongoTemplate mongoTemplate;
@Autowired
private ShunfengSignUtils shunfengSignUtils;
@Autowired @Autowired
private KylinPerformancesMapper performancesMapper; private KylinPerformancesMapper performancesMapper;
@Autowired @Autowired
private KylinOrderTicketsMapper kylinOrderTicketsMapper; private KylinOrderTicketsMapper kylinOrderTicketsMapper;
@Autowired
private KylinOrderExpressMapper kylinOrderExpressMapper;
public List<PerformanceExpressPerformanceListAdminDao> getPerformancesList(PerformanceExpressSearchAdminParam performanceExpressSearchAdminParam) { public List<PerformanceExpressPerformanceListAdminDao> getPerformancesList(PerformanceExpressSearchAdminParam performanceExpressSearchAdminParam) {
List<PerformanceExpressPerformanceListAdminDao> voList = new ArrayList(); List<PerformanceExpressPerformanceListAdminDao> voList = new ArrayList();
try { try {
...@@ -56,4 +72,65 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinPerformance ...@@ -56,4 +72,65 @@ public class PerformancesExpressServiceImpl extends ServiceImpl<KylinPerformance
} }
return voList; return voList;
} }
public ResponseDto placeOrder(PerformanceExpressSearchAdminParam performanceExpressSearchAdminParam) {
List<String> ids = performanceExpressSearchAdminParam.getIds();
for (String orderTicketsId : ids) {
KylinOrderTickets orderInfo = kylinOrderTicketsMapper.selectOne(
new QueryWrapper<KylinOrderTickets>().eq("order_tickets_id", orderTicketsId)
);
HashMap<String, Object> hBody = new HashMap<>();
hBody.put("orderId", orderInfo.getOrderCode());
hBody.put("jCompany", "摩登天空");
hBody.put("jContact", "姜秀龙");
// hBody.put("jTel", "010");
hBody.put("jMobile", "15811009011");
hBody.put("jProvince", "北京");
hBody.put("jCity", "北京市");
hBody.put("jAddress", "摩登天空");
hBody.put("dContact", "张红梅");
hBody.put("dMobile", "15010806631");
hBody.put("dProvince", "北京");
hBody.put("dCity", "北京市");
hBody.put("dAddress", "华通大厦");
hBody.put("custid", "7551234567");
hBody.put("payMethod", 0);// 运费付款方式:0-寄付月结;1-寄付现结;2-收方付;3-第三方付;
hBody.put("expressType", 1);// 顺丰特快
hBody.put("depositumInfo", "票");
hBody.put("depositumNo", 1);
// 时间戳
long currentTimeMillis = System.currentTimeMillis();
// 生成签名并请求
String result = shunfengSignUtils.generateSignatureAndRequest(currentTimeMillis + "", hBody, "/public/order/v1/placeOrder");
HashMap hashMap = JsonUtils.fromJson(result, HashMap.class);
System.out.println(result);
if (hashMap.get("succ").equals("fail")) {
String msg = (String) hashMap.get("msg");
return ResponseDto.failure(msg);
} else {
KylinOrderExpress kylinOrderExpress = new KylinOrderExpress();
String orderExpressId = IDGenerator.nextSnowId();
kylinOrderExpress.setOrderExpressId(orderExpressId);
kylinOrderExpress.setOrderTicketsId(orderTicketsId);
kylinOrderExpress.setMailno((String) hashMap.get("mailno"));
kylinOrderExpress.setExpressType(1);
kylinOrderExpress.setFilterResult((Integer) hashMap.get("filter_result"));
kylinOrderExpress.setRemark((String) hashMap.get("remark"));
kylinOrderExpress.setOrigincode((String) hashMap.get("origincode"));
kylinOrderExpress.setDestcode((String) hashMap.get("destcode"));
kylinOrderExpress.setPrintIcon((String) hashMap.get("printIcon"));
kylinOrderExpress.setPrintFlag((String) hashMap.get("printFlag"));
kylinOrderExpress.setTwoDimensionCode((String) hashMap.get("twoDimensionCode"));
kylinOrderExpress.setCreatedAt(DateUtil.getNowTime());
kylinOrderExpressMapper.insert(kylinOrderExpress);
}
}
return ResponseDto.success();
}
} }
package com.liquidnet.client.admin.zhengzai.kylin.utils; package com.liquidnet.client.admin.zhengzai.kylin.utils;
import com.liquidnet.client.admin.common.json.JSONObject;
import com.liquidnet.commons.lang.util.JsonUtils;
import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -11,9 +13,11 @@ import org.apache.http.impl.client.CloseableHttpClient; ...@@ -11,9 +13,11 @@ import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap;
/** /**
* <p> * <p>
...@@ -23,6 +27,7 @@ import java.io.IOException; ...@@ -23,6 +27,7 @@ import java.io.IOException;
* @author jiangxiulong * @author jiangxiulong
* @since 2021-06-24 8:00 下午 * @since 2021-06-24 8:00 下午
*/ */
@Component
public class ShunfengSignUtils { public class ShunfengSignUtils {
/** /**
* appId * appId
...@@ -47,18 +52,18 @@ public class ShunfengSignUtils { ...@@ -47,18 +52,18 @@ public class ShunfengSignUtils {
/** /**
* 生成签名并请求 * 生成签名并请求
* @param timestamp 时间戳 * @param timestamp 时间戳
* @param body 请求body * @param hbody 请求body
* @return * @return
*/ */
public String generateSignatureAndRequest(String timestamp, String body, String url) { public String generateSignatureAndRequest(String timestamp, HashMap<String, Object> hbody, String url) {
hbody.put("companyId", APP_ID);
String body = JsonUtils.toJson(hbody);
// 生成签名 // 生成签名
String sign = genSign(timestamp,body); String sign = genSign(timestamp,body);
System.out.println("签名:"+sign);
CloseableHttpClient client = HttpClients.createDefault(); CloseableHttpClient client = HttpClients.createDefault();
// 请求下单地址 // 请求下单地址
HttpPost httpPost = new HttpPost(URL + url); HttpPost httpPost = new HttpPost(URL + url);
System.out.println("请求的url:"+URL + url);
// sendAppId(sendAppId需赋值appId) // sendAppId(sendAppId需赋值appId)
httpPost.addHeader("sendAppId", APP_ID); httpPost.addHeader("sendAppId", APP_ID);
// 时间戳需和获取验签时一致!!! // 时间戳需和获取验签时一致!!!
...@@ -66,6 +71,7 @@ public class ShunfengSignUtils { ...@@ -66,6 +71,7 @@ public class ShunfengSignUtils {
// 签名 // 签名
httpPost.addHeader("sign", sign); httpPost.addHeader("sign", sign);
httpPost.addHeader("Content-Type", "application/json;charset=utf-8"); httpPost.addHeader("Content-Type", "application/json;charset=utf-8");
httpPost.addHeader("Accept", "application/json");
// 请求body体需和获取验签时一致且编码UTF8!!! // 请求body体需和获取验签时一致且编码UTF8!!!
httpPost.setEntity(new StringEntity(body, "utf-8")); httpPost.setEntity(new StringEntity(body, "utf-8"));
CloseableHttpResponse response = null; CloseableHttpResponse response = null;
......
package com.liquidnet.commons.lang.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface ClientUpdateAnnotation {
String version() default "100000000";
String source() default "ALL";
String path() default "NONE";
}
...@@ -42,7 +42,7 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter { ...@@ -42,7 +42,7 @@ public class GlobalAuthorityInterceptor extends HandlerInterceptorAdapter {
private static final String ENV_PROD = "prod"; private static final String ENV_PROD = "prod";
private static final String ENV_ACTIVE = "spring.profiles.active"; private static final String ENV_ACTIVE = "spring.profiles.active";
private static final String KYLIN_STATION_JWT_VALID = "/station/**"; private static final String KYLIN_STATION_JWT_VALID = "/*/station/**";
private final static AntPathMatcher antPathMatcher = new AntPathMatcher(); private final static AntPathMatcher antPathMatcher = new AntPathMatcher();
......
...@@ -31,7 +31,7 @@ liquidnet: ...@@ -31,7 +31,7 @@ liquidnet:
# port: 6380 # port: 6380
# password: PO@B!Iud32 # password: PO@B!Iud32
mongodb: mongodb:
host: s-2zef656730e5a1d4.mongodb.rds.aliyuncs.com:3717,s-2ze49872ed6aeb14.mongodb.rds.aliyuncs.com:3717 host: s-2zef656730e5a1d4-pub.mongodb.rds.aliyuncs.com:3717,s-2ze49872ed6aeb14-pub.mongodb.rds.aliyuncs.com:3717
port: 3717 port: 3717
user: root user: root
pwd: $hAh4SGcDQ pwd: $hAh4SGcDQ
......
...@@ -28,7 +28,7 @@ logging: ...@@ -28,7 +28,7 @@ logging:
console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n' console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level: level:
root: ${liquidnet.logfile.level} root: info
#以下是为指定包设置日志级别 #以下是为指定包设置日志级别
com.liquidnet: ${liquidnet.logfile.level} com.liquidnet: ${liquidnet.logfile.level}
# ----------------------------------------------------------- # -----------------------------------------------------------
......
...@@ -14,7 +14,7 @@ liquidnet: ...@@ -14,7 +14,7 @@ liquidnet:
pattern-file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n' pattern-file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n' pattern-console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level: info level: debug
rabbitmq: rabbitmq:
connection-timeout: 5000 connection-timeout: 5000
mysql: mysql:
......
...@@ -14,7 +14,7 @@ liquidnet: ...@@ -14,7 +14,7 @@ liquidnet:
pattern-file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n' pattern-file: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n' pattern-console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log pattern-rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level: info level: debug
rabbitmq: rabbitmq:
connection-timeout: 3000 connection-timeout: 3000
mysql: mysql:
......
...@@ -28,7 +28,7 @@ logging: ...@@ -28,7 +28,7 @@ logging:
console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n' console: '%d{yyyy-MM-dd HH:mm:ss.SSS} [ %-5level] %thread [%logger{96}:%line] - %msg%n'
rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log rolling-file-name: ${liquidnet.logfile.path}/${liquidnet.logfile.name}-%d{yyyy-MM-dd}.%i.log
level: level:
root: ${liquidnet.logfile.level} root: info
#以下是为指定包设置日志级别 #以下是为指定包设置日志级别
com: com:
liquidnet: ${liquidnet.logfile.level} liquidnet: ${liquidnet.logfile.level}
......
package com.liquidnet.service.kylin.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* <p>
* 订单快递
* </p>
*
* @author jiangxiulong
* @since 2021-06-25
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class KylinOrderExpress implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Integer mid;
private String orderExpressId;
private String orderTicketsId;
private String mailno;
private Integer expressType;
private Integer filterResult;
private String remark;
private String origincode;
private String destcode;
private String printIcon;
private String twoDimensionCode;
private String printFlag;
/**
* 创建时间
*/
private String createdAt;
/**
* 修改时间
*/
private String updatedAt;
}
package com.liquidnet.service.kylin.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liquidnet.service.kylin.entity.KylinOrderExpress;
/**
* <p>
* 订单快递 Mapper 接口 处理数据库
* </p>
*
* @author jiangxiulong
* @since 2021-05-01
*/
public interface KylinOrderExpressMapper extends BaseMapper<KylinOrderExpress> {
}
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
FROM kylin_order_tickets AS ot FROM kylin_order_tickets AS ot
LEFT JOIN kylin_order_ticket_status AS ots ON ots.order_id = ot.order_tickets_id LEFT JOIN kylin_order_ticket_status AS ots ON ots.order_id = ot.order_tickets_id
LEFT JOIN kylin_order_ticket_relations AS otr ON otr.order_id = ot.order_tickets_id LEFT JOIN kylin_order_ticket_relations AS otr ON otr.order_id = ot.order_tickets_id
WHERE status = 0 AND NOW() > DATE_SUB(ot.created_at,INTERVAL -pay_countdown_minute MINUTE) WHERE status = 0 AND NOW() > DATE_SUB(ot.created_at,INTERVAL -(pay_countdown_minute+1) MINUTE)
<if test="userId!=''"> <if test="userId!=''">
AND user_id = #{userId} AND user_id = #{userId}
</if> </if>
......
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
) AS 'total_sale_price' , ) AS 'total_sale_price' ,
otr.performance_id AS 'performance_id' FROM kylin_order_tickets AS ot LEFT JOIN kylin_order_ticket_status AS ots otr.performance_id AS 'performance_id' FROM kylin_order_tickets AS ot LEFT JOIN kylin_order_ticket_status AS ots
ON ots.order_id = ot.order_tickets_id LEFT JOIN kylin_order_ticket_relations AS otr ON otr.order_id = ON ots.order_id = ot.order_tickets_id LEFT JOIN kylin_order_ticket_relations AS otr ON otr.order_id =
ot.order_tickets_id WHERE ots.`status` = 1 AND coupon_type = 'no' GROUP BY otr.performance_id ot.order_tickets_id WHERE (ots.`status` = 1 or ots.`status` = 0 or ots.`status` = 3) AND coupon_type = 'no' GROUP BY otr.performance_id
) AS ot ON ot.performance_id = p.performances_id ) AS ot ON ot.performance_id = p.performances_id
<where> <where>
<if test="title!=''"> <if test="title!=''">
...@@ -198,7 +198,9 @@ ...@@ -198,7 +198,9 @@
<if test="status=='0'"> <if test="status=='0'">
AND ps.STATUS = #{status} AND ps.STATUS = #{status}
</if> </if>
<if test="merchantId!='1'">
AND pr.merchant_id = #{merchantId} AND pr.merchant_id = #{merchantId}
</if>
</where> </where>
ORDER BY ${orderItem} ${orderSc} ORDER BY ${orderItem} ${orderSc}
</select> </select>
...@@ -262,7 +264,7 @@ ...@@ -262,7 +264,7 @@
LEFT JOIN kylin_order_ticket_status AS ots ON ots.order_id = ot.order_tickets_id LEFT JOIN kylin_order_ticket_status AS ots ON ots.order_id = ot.order_tickets_id
LEFT JOIN kylin_order_ticket_relations AS otr ON otr.order_id = ot.order_tickets_id LEFT JOIN kylin_order_ticket_relations AS otr ON otr.order_id = ot.order_tickets_id
WHERE WHERE
ots.`status` = 1 and coupon_type ='no' (ots.`status` = 1 or ots.`status` = 0 or ots.`status` = 3) and coupon_type ='no'
GROUP BY otr.performance_id GROUP BY otr.performance_id
) AS ot ON ot.performance_id = p.performances_id ) AS ot ON ot.performance_id = p.performances_id
<where> <where>
...@@ -385,54 +387,81 @@ ...@@ -385,54 +387,81 @@
<!-- 演出订单统计--> <!-- 演出订单统计-->
<select id="getPerformanceOrderStatisticalList" parameterType="java.lang.String" <select id="getPerformanceOrderStatisticalList" parameterType="java.lang.String"
resultMap="performanceOrderStatisticalDaoResult"> resultMap="performanceOrderStatisticalDaoResult">
SELECT kp.performances_id, SELECT
kp.performances_id ,
kt.tickets_id, kt.tickets_id,
kt.title, kt.title,
kt.price, kt.price,
kt.type, kt.type,
kt.use_start, kt.use_start,
IFNULL(kts.total_general, 0) AS 'total_general', IFNULL(kts.total_general , 0) AS 'total_general' ,
IFNULL(ot.total_sale_general, 0) AS 'sale_general', IFNULL(ot.total_sale_general , 0) AS 'sale_general' ,
IFNULL((kts.total_general - ot.total_sale_general), 0) AS 'surplus_general', IFNULL((kts.total_general - IFNULL(ot.total_sale_general,0) - IFNULL(otp.total_paying_number , 0)),0) AS 'surplus_general',
IFNULL(ot.total_sale_price, 0) AS 'total_sale_price', IFNULL(ot.total_sale_price , 0) AS 'total_sale_price' ,
IFNULL(kts.total_exchange, 0) AS 'total_exchange', IFNULL(kts.total_exchange , 0) AS 'total_exchange',
IFNULL(ot.total_refund_general, 0) AS 'total_refund_general', IFNULL(rd.total_refund_general , 0) AS 'total_refund_general',
IFNULL(ot.total_refund_price, 0) AS 'total_refund_price', IFNULL(rd.total_refund_price , 0) AS 'total_refund_price',
IFNULL(ot.total_member_number, 0) AS 'total_member_number', IFNULL(ot.total_member_number , 0) AS 'total_member_number',
IFNULL(ot.total_paying_number, 0) AS 'total_paying_number', IFNULL(otp.total_paying_number , 0) AS 'total_paying_number',
IFNULL(ut.total_buy_users, 0) AS 'total_buy_users' IFNULL(ut.total_buy_users , 0) AS 'total_buy_users'
FROM (select t.performances_id from kylin_performances t where t.performances_id = ${performancesId}) AS kp FROM
inner JOIN( (select t.performances_id,ktr.ticket_id from kylin_performances t inner join kylin_ticket_time_relation kttr
SELECT kotr.performance_id AS 'performance_id', on t.performances_id = kttr.performance_id
inner join kylin_ticket_relations ktr on kttr.times_id = ktr.times_id
where t.performances_id = ${performancesId}) AS kp
left JOIN(
SELECT
kotr.performance_id AS 'performance_id',
kotr.ticket_id, kotr.ticket_id,
(sum(kot.number) - sum(kot.refund_number)) AS 'total_sale_general', sum(kot.number) AS 'total_sale_general' ,
(sum(kot.price_actual) - sum(kot.price_refund)) AS 'total_sale_price', sum(kot.price_actual) AS 'total_sale_price',
sum(case when kotr.is_member = 1 then kot.number else 0 end) total_member_number
FROM
kylin_order_ticket_relations kotr
inner join kylin_order_tickets AS kot on kotr.order_id = kot.order_tickets_id
inner JOIN kylin_order_ticket_status AS kots ON kots.order_id = kot.order_tickets_id
WHERE 1>0 and kotr.performance_id = ${performancesId}
and kots.`status` in(1,3) and kot.coupon_type ='no'
group by kotr.performance_id,kotr.ticket_id
) AS ot ON (ot.performance_id = kp.performances_id and ot.ticket_id = kp.ticket_id)
left JOIN(
SELECT
kotr.performance_id,kotr.ticket_id,
sum(ifnull(kot.number,0)) total_paying_number
FROM
kylin_order_ticket_relations kotr
inner join kylin_order_tickets AS kot on kotr.order_id = kot.order_tickets_id
inner JOIN kylin_order_ticket_status AS kots ON kots.order_id = kot.order_tickets_id
WHERE 1>0 and kotr.performance_id = ${performancesId}
and kots.`status` = 0 and kot.coupon_type ='no'
group by kotr.performance_id,kotr.ticket_id
) AS otp ON (otp.performance_id = kp.performances_id and otp.ticket_id = kp.ticket_id)
left JOIN(
SELECT
kotr.performance_id,kotr.ticket_id,
sum(kot.refund_number) as 'total_refund_general', sum(kot.refund_number) as 'total_refund_general',
sum(kot.price_refund) as 'total_refund_price', sum(kot.price_refund) as 'total_refund_price'
sum(case when kotr.is_member = 1 then kot.number else 0 end) total_member_number, FROM
sum(case when kots.`status` = 0 then kot.number else 0 end) total_paying_number kylin_order_ticket_relations kotr
FROM kylin_order_ticket_relations kotr
inner join kylin_order_tickets AS kot on kotr.order_id = kot.order_tickets_id inner join kylin_order_tickets AS kot on kotr.order_id = kot.order_tickets_id
inner JOIN kylin_order_ticket_status AS kots ON kots.order_id = kot.order_tickets_id inner JOIN kylin_order_ticket_status AS kots ON kots.order_id = kot.order_tickets_id
WHERE 1 > 0 WHERE 1>0 and kotr.performance_id = ${performancesId}
and kotr.performance_id = ${performancesId} and kots.`status` = 4 and kot.coupon_type ='no'
and kots.`status` in (1, 3, 4) group by kotr.performance_id,kotr.ticket_id
and kot.coupon_type = 'no' ) AS rd ON (rd.performance_id = kp.performances_id and rd.ticket_id = kp.ticket_id)
group by kotr.performance_id, kotr.ticket_id left join kylin_tickets kt on kt.tickets_id = kp.ticket_id
) AS ot ON ot.performance_id = kp.performances_id left join kylin_ticket_status kts on kts.ticket_id = kp.ticket_id
inner join kylin_tickets kt on kt.tickets_id = ot.ticket_id left JOIN(
inner join kylin_ticket_status kts on kts.ticket_id = kt.tickets_id select t.performance_id,count(t.user_id) as 'total_buy_users' from(
inner JOIN( SELECT
select t.performance_id, count(t.user_id) as 'total_buy_users' kotr.performance_id,
from (
SELECT kotr.performance_id,
kot.user_id kot.user_id
FROM kylin_order_ticket_relations kotr FROM
kylin_order_ticket_relations kotr
inner join kylin_order_tickets AS kot on kotr.order_id = kot.order_tickets_id inner join kylin_order_tickets AS kot on kotr.order_id = kot.order_tickets_id
inner JOIN kylin_order_ticket_status AS kots ON kots.order_id = kot.order_tickets_id inner JOIN kylin_order_ticket_status AS kots ON kots.order_id = kot.order_tickets_id
WHERE kotr.performance_id = ${performancesId} WHERE kotr.performance_id = ${performancesId} and kots.`status` in (0,1,3)
and (kots.`status` = 0 OR kots.`status` = 1) group by kotr.performance_id,kot.user_id
group by kotr.performance_id, kot.user_id
) t ) t
) AS ut ON ut.performance_id = kp.performances_id ) AS ut ON ut.performance_id = kp.performances_id
</select> </select>
......
...@@ -415,7 +415,7 @@ public class AdamMemberOrderServiceImpl extends ServiceImpl<AdamMemberOrderMappe ...@@ -415,7 +415,7 @@ public class AdamMemberOrderServiceImpl extends ServiceImpl<AdamMemberOrderMappe
s = System.currentTimeMillis(); s = System.currentTimeMillis();
rabbitTemplate.convertAndSend(MQConst.EX_LNS_SQL_UCENTER, MQConst.RK_SQL_UMEMBER, rabbitTemplate.convertAndSend(MQConst.EX_LNS_SQL_UCENTER, MQConst.RK_SQL_UMEMBER,
SqlMapping.gets(toMqSqls, updateMemberCodeObjs, initMemberOrderObjs, upsertUserMemberObjs)); SqlMapping.gets(toMqSqls, upsertUserMemberObjs, updateMemberCodeObjs, initMemberOrderObjs));
log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s); log.debug("#MQ耗时:{}ms", System.currentTimeMillis() - s);
AdamMemberOrderResult result = AdamMemberOrderResult.getNew(); AdamMemberOrderResult result = AdamMemberOrderResult.getNew();
......
...@@ -20,6 +20,7 @@ public class KylinUtils { ...@@ -20,6 +20,7 @@ public class KylinUtils {
@Autowired @Autowired
private RedisUtil redisUtil; private RedisUtil redisUtil;
/** /**
* @param userId 用户id * @param userId 用户id
* @param type 1新增 2修改 * @param type 1新增 2修改
...@@ -31,13 +32,13 @@ public class KylinUtils { ...@@ -31,13 +32,13 @@ public class KylinUtils {
KylinOrderListVo voItem = new KylinOrderListVo(); KylinOrderListVo voItem = new KylinOrderListVo();
KylinOrderTicketVo data; KylinOrderTicketVo data;
if (dataSingle == null) { if (dataSingle == null) {
data = (KylinOrderTicketVo)redisUtil.get(KylinRedisConst.ORDER + orderId); data = (KylinOrderTicketVo) redisUtil.get(KylinRedisConst.ORDER + orderId);
} else { } else {
data = dataSingle; data = dataSingle;
} }
BeanUtils.copyProperties(data, voItem); BeanUtils.copyProperties(data, voItem);
List<KylinOrderListVo> redisData = (List<KylinOrderListVo>) redisUtil.get(KylinRedisConst.ORDER_LIST + userId); List<KylinOrderListVo> redisData = (List<KylinOrderListVo>) redisUtil.get(KylinRedisConst.ORDER_LIST + userId);
if(type == 1) { if (type == 1) {
redisVo.add(voItem); redisVo.add(voItem);
if (redisData.size() > 0) { if (redisData.size() > 0) {
if (redisData.get(0).getOrderTicketsId().equals(orderId)) { if (redisData.get(0).getOrderTicketsId().equals(orderId)) {
...@@ -63,7 +64,7 @@ public class KylinUtils { ...@@ -63,7 +64,7 @@ public class KylinUtils {
if (redisVo.size() == 0) { if (redisVo.size() == 0) {
vo.add(voItem); vo.add(voItem);
} }
redisUtil.set(KylinRedisConst.ORDER_LIST + userId,vo); redisUtil.set(KylinRedisConst.ORDER_LIST + userId, vo);
return true; return true;
case 2: case 2:
for (int i = 0; i < redisVo.size(); i++) { for (int i = 0; i < redisVo.size(); i++) {
...@@ -76,7 +77,7 @@ public class KylinUtils { ...@@ -76,7 +77,7 @@ public class KylinUtils {
vo.add(redisVo.get(i)); vo.add(redisVo.get(i));
} }
} }
redisUtil.set(KylinRedisConst.ORDER_LIST + userId,vo); redisUtil.set(KylinRedisConst.ORDER_LIST + userId, vo);
return true; return true;
default: default:
return false; return false;
...@@ -116,56 +117,65 @@ public class KylinUtils { ...@@ -116,56 +117,65 @@ public class KylinUtils {
String ticketIdKey = redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId; String ticketIdKey = redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
String ticketUseTimeKey = ticketIdKey + ":" + KylinRedisConst.USE_TIME; String ticketUseTimeKey = ticketIdKey + ":" + KylinRedisConst.USE_TIME;
redisUtil.set(ticketUseTimeKey, useTime); redisUtil.set(ticketUseTimeKey, useTime);
if (buyCount > 0) { if (buyCount > 0) {
redisUtil.incr(ticketIdKey, buyCount); redisUtil.incr(ticketIdKey, buyCount);
if (1 == ticketType) {
int count = 0;
for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
String item = allTicketId.get(useTime).get(i);
if (allTicketId.get(useTime).size() == 1) {
redisUtil.incr(performanceIdKey, buyCount);
break;
}
if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
}
if (i == 0) {
count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
} else {
if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.incr(performanceIdKey, buyCount); redisUtil.incr(performanceIdKey, buyCount);
break;
}
}
}
} else {
redisUtil.incr(performanceIdKey, buyCount);
}
} else { } else {
redisUtil.decr(ticketIdKey, Math.abs(buyCount)); redisUtil.decr(ticketIdKey, Math.abs(buyCount));
if (1 == ticketType) {
int count = 0;
for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
String item = allTicketId.get(useTime).get(i);
if (allTicketId.get(useTime).size() == 1) {
redisUtil.decr(performanceIdKey, Math.abs(buyCount)); redisUtil.decr(performanceIdKey, Math.abs(buyCount));
break;
}
if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
}
if (i == 0) {
count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
} else {
if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.decr(performanceIdKey, Math.abs(buyCount));
break;
}
}
}
} else {
redisUtil.decr(performanceIdKey, Math.abs(buyCount));
}
} }
// if (buyCount > 0) {
// redisUtil.incr(ticketIdKey, buyCount);
// if (1 == ticketType) {
// int count = 0;
// for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
// String item = allTicketId.get(useTime).get(i);
// if (allTicketId.get(useTime).size() == 1) {
// redisUtil.incr(performanceIdKey, buyCount);
// break;
// }
// if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
// }
// if (i == 0) {
// count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
// } else {
// if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.incr(performanceIdKey, buyCount);
// break;
// }
// }
// }
// } else {
// redisUtil.incr(performanceIdKey, buyCount);
// }
// } else {
// redisUtil.decr(ticketIdKey, Math.abs(buyCount));
// if (1 == ticketType) {
// int count = 0;
// for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
// String item = allTicketId.get(useTime).get(i);
// if (allTicketId.get(useTime).size() == 1) {
// redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// break;
// }
// if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
// }
// if (i == 0) {
// count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
// } else {
// if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// break;
// }
// }
// }
// } else {
// redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// }
// }
} }
} }
...@@ -744,3 +744,26 @@ CREATE TABLE `kylin_order_refund_entities` ...@@ -744,3 +744,26 @@ CREATE TABLE `kylin_order_refund_entities`
) ENGINE = InnoDB ) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4 DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT '退款入场人表'; COLLATE = utf8mb4_unicode_ci COMMENT '退款入场人表';
drop TABLE if exists `kylin_order_express`;
CREATE TABLE `kylin_order_express`
(
`mid` int unsigned NOT NULL AUTO_INCREMENT,
`order_express_id` varchar(255) NOT NULL DEFAULT '' COMMENT 'order_express_id',
`order_tickets_id` varchar(255) NOT NULL DEFAULT '' COMMENT '订单id',
`mailno` varchar(255) NOT NULL DEFAULT '' COMMENT '顺丰运单号',
`express_type` tinyint NOT NULL DEFAULT '0' COMMENT '快件产品类型 1顺丰特快...',
`filter_result` tinyint NOT NULL DEFAULT '0' COMMENT '1-人工确认;2-可收派;3-不可以收派',
`remark` varchar(255) NOT NULL DEFAULT '' COMMENT 'filter_result=3时返回不可以收派的原因代码',
`origincode` varchar(255) NOT NULL DEFAULT '' COMMENT '原寄地区域代码 可用于顺丰电子面单标签打印',
`destcode` varchar(255) NOT NULL DEFAULT '' COMMENT '目的地区域代码 可用于顺丰电子面单标签打印',
`print_icon` varchar(255) NOT NULL DEFAULT '' COMMENT '打印图标',
`print_flag` varchar(255) NOT NULL DEFAULT '' COMMENT '打印标志',
`two_dimension_code` varchar(255) NOT NULL DEFAULT '' COMMENT '二维码',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
KEY `kylin_order_express_order_express_id_index` (`order_express_id`),
PRIMARY KEY (`mid`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT '订单快递表';
...@@ -55,7 +55,7 @@ public class KylinOrderTicketsController { ...@@ -55,7 +55,7 @@ public class KylinOrderTicketsController {
public ResponseDto<PayResultVo> payAgain(@RequestBody @Valid PayAgainParam payAgainParam) { public ResponseDto<PayResultVo> payAgain(@RequestBody @Valid PayAgainParam payAgainParam) {
PayResultVo vo = orderTicketsService.payAgain(payAgainParam).getData(); PayResultVo vo = orderTicketsService.payAgain(payAgainParam).getData();
if (null == vo) { if (null == vo) {
return ResponseDto.failure(ErrorMapping.get("20003")); return ResponseDto.failure("订单已失效");
} else { } else {
return ResponseDto.success(vo); return ResponseDto.success(vo);
} }
......
...@@ -5,12 +5,11 @@ import com.liquidnet.common.mq.constant.MQConst; ...@@ -5,12 +5,11 @@ import com.liquidnet.common.mq.constant.MQConst;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.base.SqlMapping; import com.liquidnet.service.base.SqlMapping;
import com.liquidnet.service.kylin.dto.param.KylinStationCheckOrderParam; import com.liquidnet.service.kylin.dto.param.KylinStationUploadParam;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketEntitiesVo; import com.liquidnet.service.kylin.dto.vo.mongo.KylinOrderTicketEntitiesVo;
import com.liquidnet.service.kylin.entity.KylinOrderTicketEntities; import com.liquidnet.service.kylin.entity.KylinOrderTicketEntities;
import com.liquidnet.service.kylin.mapper.KylinOrderTicketEntitiesMapper; import com.liquidnet.service.kylin.mapper.KylinOrderTicketEntitiesMapper;
import com.liquidnet.service.kylin.service.IKylinOrderTicketEntitiesService; import com.liquidnet.service.kylin.service.IKylinOrderTicketEntitiesService;
import com.liquidnet.service.kylin.utils.DataUtils;
import com.mongodb.bulk.BulkWriteResult; import com.mongodb.bulk.BulkWriteResult;
import com.mongodb.client.model.UpdateOneModel; import com.mongodb.client.model.UpdateOneModel;
import com.mongodb.client.model.WriteModel; import com.mongodb.client.model.WriteModel;
...@@ -19,12 +18,9 @@ import org.bson.Document; ...@@ -19,12 +18,9 @@ import org.bson.Document;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.convert.MongoConverter;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -42,18 +38,14 @@ import java.util.List; ...@@ -42,18 +38,14 @@ import java.util.List;
@Slf4j @Slf4j
@Service @Service
public class KylinOrderTicketEntitiesServiceImpl extends ServiceImpl<KylinOrderTicketEntitiesMapper, KylinOrderTicketEntities> implements IKylinOrderTicketEntitiesService { public class KylinOrderTicketEntitiesServiceImpl extends ServiceImpl<KylinOrderTicketEntitiesMapper, KylinOrderTicketEntities> implements IKylinOrderTicketEntitiesService {
@Autowired
MongoConverter mongoConverter;
@Autowired @Autowired
MongoTemplate mongoTemplate; MongoTemplate mongoTemplate;
@Autowired @Autowired
RabbitTemplate rabbitTemplate; RabbitTemplate rabbitTemplate;
@Autowired
DataUtils dataUtils;
@Override @Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) // @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void updateByStation(List<KylinStationCheckOrderParam> checkOrderParamList) { public void updateByStation(KylinStationUploadParam parameter) {
// // 根据验票用户ID分组 // // 根据验票用户ID分组
// Map<String, List<KylinStationCheckOrderParam>> checkOrderByUserIdMap = checkOrderParamList.stream().collect(Collectors.groupingBy(KylinStationCheckOrderParam::getCheckUserId)); // Map<String, List<KylinStationCheckOrderParam>> checkOrderByUserIdMap = checkOrderParamList.stream().collect(Collectors.groupingBy(KylinStationCheckOrderParam::getCheckUserId));
// //
...@@ -68,19 +60,24 @@ public class KylinOrderTicketEntitiesServiceImpl extends ServiceImpl<KylinOrderT ...@@ -68,19 +60,24 @@ public class KylinOrderTicketEntitiesServiceImpl extends ServiceImpl<KylinOrderT
String nowDtStr = DateUtil.format(nowDt, DateUtil.Formatter.yyyyMMddHHmmss); String nowDtStr = DateUtil.format(nowDt, DateUtil.Formatter.yyyyMMddHHmmss);
LinkedList<Object[]> paramsList = new LinkedList<>(); LinkedList<Object[]> paramsList = new LinkedList<>();
List<WriteModel<Document>> list = new ArrayList<>(); List<WriteModel<Document>> list = new ArrayList<>();
checkOrderParamList.forEach(r -> { parameter.getCheckOrderParamList().forEach(r -> {
KylinOrderTicketEntitiesVo updateVo = KylinOrderTicketEntitiesVo.getNew(); KylinOrderTicketEntitiesVo updateVo = KylinOrderTicketEntitiesVo.getNew();
updateVo.setStatus(1);// 出票状态: 0未出票 1已出票
updateVo.setCheckClient(parameter.getCheckClient());
updateVo.setUpdatedAt(nowDtStr);
updateVo.setCheckType(r.getCheckType()); updateVo.setCheckType(r.getCheckType());
updateVo.setCheckedAt(r.getCheckedAt()); updateVo.setCheckedAt(r.getCheckedAt());
updateVo.setCheckUserId(r.getCheckUserId()); updateVo.setCheckUserId(r.getCheckUserId());
updateVo.setUpdatedAt(nowDtStr);
updateVo.setStatus(1);
// dataUtils.delOrderTicketEntitiesRedis(r.getTicketEntitiesId());
paramsList.add(new Object[]{1, nowDtStr, r.getCheckedAt(), r.getCheckType(), r.getCheckUserId(), r.getTicketEntitiesId()}); paramsList.add(new Object[]{1, updateVo.getCheckClient() + updateVo.getCheckType(), nowDt, r.getTicketEntitiesId()});
Document updateQuery = Query.query(Criteria.where("orderTicketEntitiesId").is(r.getTicketEntitiesId())).getQueryObject(); Document updateQuery = Query.query(Criteria.where("orderTicketEntitiesId").is(r.getTicketEntitiesId())).getQueryObject();
list.add(new UpdateOneModel<Document>(updateQuery, new Document("$set", Document.parse(JsonUtils.toJson(updateVo))))); Document updateDoc = new Document("status", updateVo.getStatus())
.append("checkClient", updateVo.getCheckClient())
.append("updatedAt", updateVo.getUpdatedAt())
.append("checkType", updateVo.getCheckType())
.append("checkedAt", updateVo.getCheckedAt())
.append("checkUserId", updateVo.getUserId());
list.add(new UpdateOneModel<Document>(updateQuery, new Document("$set", updateDoc)));
}); });
BulkWriteResult bulkWriteResult = mongoTemplate.getCollection(KylinOrderTicketEntitiesVo.class.getSimpleName()).bulkWrite(list); BulkWriteResult bulkWriteResult = mongoTemplate.getCollection(KylinOrderTicketEntitiesVo.class.getSimpleName()).bulkWrite(list);
log.info("bulkWriteResult:{}", JsonUtils.toJson(bulkWriteResult)); log.info("bulkWriteResult:{}", JsonUtils.toJson(bulkWriteResult));
......
...@@ -362,11 +362,11 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -362,11 +362,11 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
orderTickets.setPriceTotal(ticketData.getPrice().multiply(new BigDecimal(payOrderParam.getNumber())).add(payOrderParam.getIsExpress() == 1 ? ticketData.getPriceExpress() : new BigDecimal("0"))); orderTickets.setPriceTotal(ticketData.getPrice().multiply(new BigDecimal(payOrderParam.getNumber())).add(payOrderParam.getIsExpress() == 1 ? ticketData.getPriceExpress() : new BigDecimal("0")));
} }
if (Arrays.asList("dev", "test").contains(environment.getProperty("spring.profiles.active"))) { /*if (Arrays.asList("dev", "test").contains(environment.getProperty("spring.profiles.active"))) {
orderTickets.setPriceActual(new BigDecimal("0.01")); orderTickets.setPriceActual(new BigDecimal("0.01"));
} else { } else {*/
orderTickets.setPriceActual(orderTickets.getPriceTotal()); orderTickets.setPriceActual(orderTickets.getPriceTotal());
} /*}*/
orderTickets.setPriceVoucher(new BigDecimal("0.0")); orderTickets.setPriceVoucher(new BigDecimal("0.0"));
orderTickets.setPriceExpress(ticketData.getPriceExpress()); orderTickets.setPriceExpress(ticketData.getPriceExpress());
...@@ -531,11 +531,11 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -531,11 +531,11 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
LinkedMultiValueMap<String, String> httpData = new LinkedMultiValueMap<String, String>(); LinkedMultiValueMap<String, String> httpData = new LinkedMultiValueMap<String, String>();
httpData.add("type", "TICKET"); httpData.add("type", "TICKET");
if (Arrays.asList("dev", "test").contains(environment.getProperty("spring.profiles.active"))) { /*if (Arrays.asList("dev", "test").contains(environment.getProperty("spring.profiles.active"))) {
httpData.add("price", "0.01"); httpData.add("price", "0.01");
} else { } else {*/
httpData.add("price", orderTickets.getPriceActual().toString()); httpData.add("price", orderTickets.getPriceActual().toString());
} // }
httpData.add("name", useTime + ticketData.getTitle() + "-" + performanceData.getTitle()); httpData.add("name", useTime + ticketData.getTitle() + "-" + performanceData.getTitle());
httpData.add("detail", performanceData.getTitle() + "-" + ticketData.getTitle() + "-" + useTime); httpData.add("detail", performanceData.getTitle() + "-" + ticketData.getTitle() + "-" + useTime);
httpData.add("order_code", orderTickets.getOrderCode()); httpData.add("order_code", orderTickets.getOrderCode());
...@@ -921,6 +921,9 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -921,6 +921,9 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
DateUtil.parse(item.getOverdueAt(), "yyyy-MM-dd HH:mm:ss"), DateUtil.parse(item.getOverdueAt(), "yyyy-MM-dd HH:mm:ss"),
DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM-dd HH:mm:ss") DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM-dd HH:mm:ss")
)); ));
if (item.getRestTime() <= 0L) {
item.setRestTime(0L);
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -948,6 +951,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -948,6 +951,7 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
@Override @Override
public OrderDetailsVo orderDetails(String orderId) { public OrderDetailsVo orderDetails(String orderId) {
log.error("调用订单详情");
OrderDetailsVo vo = new OrderDetailsVo(); OrderDetailsVo vo = new OrderDetailsVo();
try { try {
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
...@@ -1010,6 +1014,9 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -1010,6 +1014,9 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
DateUtil.parse(orderTicketVo.getOverdueAt(), "yyyy-MM-dd HH:mm:ss"), DateUtil.parse(orderTicketVo.getOverdueAt(), "yyyy-MM-dd HH:mm:ss"),
DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM-dd HH:mm:ss") DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM-dd HH:mm:ss")
)); ));
if (vo.getRestTime() <= 0L) {
vo.setRestTime(0L);
}
} else { } else {
vo.setRestTime(0L); vo.setRestTime(0L);
} }
...@@ -1026,9 +1033,10 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -1026,9 +1033,10 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
vo.setOrderTicketVo(orderTicketVo); vo.setOrderTicketVo(orderTicketVo);
vo.setEnterDescribe(dataUtils.getEnterInfo("1")); vo.setEnterDescribe(dataUtils.getEnterInfo("1"));
} }
log.info(UserPathDto.setData("订单列表", orderId, vo)); log.info(UserPathDto.setData("订单详情", orderId, vo));
return vo; return vo;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
return vo; return vo;
} }
} }
...@@ -1183,12 +1191,22 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM ...@@ -1183,12 +1191,22 @@ public class KylinOrderTicketsServiceImpl extends ServiceImpl<KylinOrderTicketsM
public ResponseDto<Integer> orderUnPayCount() { public ResponseDto<Integer> orderUnPayCount() {
String uid = CurrentUtil.getCurrentUid(); String uid = CurrentUtil.getCurrentUid();
List<KylinOrderListVo> voList = dataUtils.getOrderList(uid); List<KylinOrderListVo> voList = dataUtils.getOrderList(uid);
Integer unPayCount = 0; int unPayCount = 0;
for (KylinOrderListVo item : voList) { for (KylinOrderListVo item : voList) {
if (item.getStatus() == 0) {
if (item.getStatus().equals(KylinTableStatusConst.ORDER_STATUS0)) {
item.setRestTime(DateUtil.intervalSeconds(
DateUtil.parse(item.getOverdueAt(), "yyyy-MM-dd HH:mm:ss"),
DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM-dd HH:mm:ss")
));
if (item.getRestTime() <= 0L) {
item.setRestTime(0L);
} else {
unPayCount += 1; unPayCount += 1;
} }
} else {
item.setRestTime(0L);
}
} }
return ResponseDto.success(unPayCount); return ResponseDto.success(unPayCount);
} }
......
...@@ -166,6 +166,9 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM ...@@ -166,6 +166,9 @@ public class KylinPerformancesServiceImpl extends ServiceImpl<KylinPerformancesM
public KylinPerformanceVo detail(String performancesId, double latitudeFrom, double longitudeFrom, String agentId) { public KylinPerformanceVo detail(String performancesId, double latitudeFrom, double longitudeFrom, String agentId) {
KylinPerformanceVo performancesInfo = dataUtils.getPerformanceVo(performancesId); KylinPerformanceVo performancesInfo = dataUtils.getPerformanceVo(performancesId);
if (null == performancesInfo) {
return performancesInfo;
}
String agentName = dataUtils.getAgentInfoName(agentId); String agentName = dataUtils.getAgentInfoName(agentId);
performancesInfo.setAgentName(agentName); performancesInfo.setAgentName(agentName);
try { try {
......
...@@ -3,6 +3,7 @@ package com.liquidnet.service.kylin.service.impl; ...@@ -3,6 +3,7 @@ package com.liquidnet.service.kylin.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.liquidnet.commons.lang.util.CollectionUtil;
import com.liquidnet.commons.lang.util.DateUtil; import com.liquidnet.commons.lang.util.DateUtil;
import com.liquidnet.commons.lang.util.IDGenerator; import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.commons.lang.util.JsonUtils; import com.liquidnet.commons.lang.util.JsonUtils;
...@@ -218,6 +219,9 @@ public class KylinRefundsStatusServiceImpl { ...@@ -218,6 +219,9 @@ public class KylinRefundsStatusServiceImpl {
double RefundPriceExpress, double RefundPriceExpress,
List<String> ticketEntityIds, List<Double> entitiesPrice List<String> ticketEntityIds, List<Double> entitiesPrice
) { ) {
if (CollectionUtil.isEmpty(ticketEntityIds)) {
return false;
}
// 基础数据 // 基础数据
String authId = ""; String authId = "";
String authName = "system_overtime_order_refund"; String authName = "system_overtime_order_refund";
......
...@@ -211,9 +211,13 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -211,9 +211,13 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
PerformancePartnerVo data = mongoTemplate.findOne( PerformancePartnerVo data = mongoTemplate.findOne(
Query.query(Criteria.where("performancesId").is(performancesId)), PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName() Query.query(Criteria.where("performancesId").is(performancesId)), PerformancePartnerVo.class, PerformancePartnerVo.class.getSimpleName()
); );
KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId));
if (data == null) { if (data == null) {
return ResponseDto.failure(ErrorMapping.get(20104)); return ResponseDto.failure(ErrorMapping.get(20104));
} }
if(null!=performanceStatus) {
data.setStatus(performanceStatus.getStatus());
}
return ResponseDto.success(data); return ResponseDto.success(data);
} }
...@@ -229,7 +233,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -229,7 +233,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
} else if (performanceStatus.getStatus() == 1 || performanceStatus.getStatus() == 3 || performanceStatus.getStatus() == 6 || performanceStatus.getStatus() == 7 || performanceStatus.getStatus() == 8 || performanceStatus.getStatus() == 9 ) {// 修改 } else if (performanceStatus.getStatus() == 1 || performanceStatus.getStatus() == 3 || performanceStatus.getStatus() == 6 || performanceStatus.getStatus() == 7 || performanceStatus.getStatus() == 8 || performanceStatus.getStatus() == 9 ) {// 修改
result = updateStep2(step2Param); result = updateStep2(step2Param);
}else if(performanceStatus.getStatus() == 10){ }else if(performanceStatus.getStatus() == 10){
result = ResponseDto.success("演出已结束不可修改"); result = ResponseDto.failure("演出已结束不可修改");
} }
} }
return result; return result;
...@@ -406,6 +410,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -406,6 +410,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
ticketSellTime.setTimeEnd(DateUtil.Formatter.yyyyMMddHHmmss.parse(ticketItem.getTimeEnd())); ticketSellTime.setTimeEnd(DateUtil.Formatter.yyyyMMddHHmmss.parse(ticketItem.getTimeEnd()));
ticketSellTime.setTimeStart(DateUtil.Formatter.yyyyMMddHHmmss.parse(ticketItem.getTimeStart())); ticketSellTime.setTimeStart(DateUtil.Formatter.yyyyMMddHHmmss.parse(ticketItem.getTimeStart()));
ticketSellTime.setAdvanceMinuteMember(null); ticketSellTime.setAdvanceMinuteMember(null);
ticketSellTime.setPayCountdownMinute(kylinPerformanceMisVo.getPayCountdownMinute());
//修改 价格 //修改 价格
ticketSellTime.setPrice(ticketItem.getPrice()); ticketSellTime.setPrice(ticketItem.getPrice());
ticketSellTime.setPriceDiscountMember(null); ticketSellTime.setPriceDiscountMember(null);
...@@ -454,6 +459,13 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -454,6 +459,13 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
PerformanceStep2Param performanceStep2Param = new PerformanceStep2Param(); PerformanceStep2Param performanceStep2Param = new PerformanceStep2Param();
BeanUtils.copyProperties(data, performanceStep2Param); BeanUtils.copyProperties(data, performanceStep2Param);
KylinPerformanceStatus performanceStatus = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId));
if(null!=performanceStatus) {
performanceStep2Param.setStatus(performanceStatus.getStatus());
}else{
performanceStep2Param.setStatus(-1);
}
performanceStep2Param.setTicketTimes(ticketTimesTicketCreatePartnerVoList); performanceStep2Param.setTicketTimes(ticketTimesTicketCreatePartnerVoList);
return ResponseDto.success(performanceStep2Param); return ResponseDto.success(performanceStep2Param);
} }
...@@ -514,7 +526,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor ...@@ -514,7 +526,7 @@ public class KylinPerformancesPartnerServiceImpl extends ServiceImpl<KylinPerfor
KylinPerformanceStatus performanceStatusData = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId)); KylinPerformanceStatus performanceStatusData = performanceStatusMapper.selectOne(new UpdateWrapper<KylinPerformanceStatus>().eq("performance_id", performancesId));
if (performanceStatusData.getStatus() >= 3 && performanceStatusData.getStatus() != 4 && performanceStatusData.getStatus() != 7) {//未提审||被拒绝 if (performanceStatusData.getStatus() >= 3 && performanceStatusData.getStatus() != 4 && performanceStatusData.getStatus() != 7 && performanceStatusData.getStatus() != 10) {//未提审||被拒绝
LocalDateTime updatedAt = LocalDateTime.now(); LocalDateTime updatedAt = LocalDateTime.now();
KylinPerformanceStatus performanceStatus = new KylinPerformanceStatus(); KylinPerformanceStatus performanceStatus = new KylinPerformanceStatus();
performanceStatus.setStatus(7); performanceStatus.setStatus(7);
......
...@@ -309,77 +309,29 @@ public class DataUtils { ...@@ -309,77 +309,29 @@ public class DataUtils {
allTicketId.put(timeItem.getUseStart(), ticketList); allTicketId.put(timeItem.getUseStart(), ticketList);
} }
System.out.println(" PERFORMANCE_ID = "+performanceId);
if (0 == isTrueName) { if (0 == isTrueName) {
redisKey = KylinRedisConst.USERID_BUY_INFO + userId; redisKey = KylinRedisConst.USERID_BUY_INFO + userId;
} else { } else {
redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard; redisKey = KylinRedisConst.IDCARD_BUY_INFO + idCard;
} }
System.out.println(" REDIS KEY= "+redisKey);
String performanceIdKey = redisKey + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId; String performanceIdKey = redisKey + ":" + KylinRedisConst.PERFORMANCE_ID + ":" + performanceId;
String ticketIdKey = redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId; String ticketIdKey = redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + ticketId;
String ticketUseTimeKey = ticketIdKey + ":" + KylinRedisConst.USE_TIME; String ticketUseTimeKey = ticketIdKey + ":" + KylinRedisConst.USE_TIME;
System.out.println("PERFORMANCEID REDIS KEY = "+performanceIdKey);
System.out.println("TICKETID REDIS KEY = "+ticketIdKey);
redisUtil.set(ticketUseTimeKey, useTime); redisUtil.set(ticketUseTimeKey, useTime);
if (buyCount > 0) { if (buyCount > 0) {
redisUtil.incr(ticketIdKey, buyCount); redisUtil.incr(ticketIdKey, buyCount);
if (1 == ticketType) {
int count = 0;
for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
String item = allTicketId.get(useTime).get(i);
if (allTicketId.get(useTime).size() == 1) {
redisUtil.incr(performanceIdKey, buyCount);
break;
}
if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
}
if (i == 0) {
count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
} else {
if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.incr(performanceIdKey, buyCount);
break;
}
}
}
} else {
System.out.println("BUY_COUNT = "+buyCount);
redisUtil.incr(performanceIdKey, buyCount); redisUtil.incr(performanceIdKey, buyCount);
} }else{
} else { redisUtil.decr(ticketIdKey, buyCount);
redisUtil.decr(ticketIdKey, Math.abs(buyCount)); redisUtil.decr(performanceIdKey, buyCount);
if (1 == ticketType) {
int count = 0;
for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
String item = allTicketId.get(useTime).get(i);
if (allTicketId.get(useTime).size() == 1) {
redisUtil.decr(performanceIdKey, Math.abs(buyCount));
break;
}
if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
}
if (i == 0) {
count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
} else {
if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
redisUtil.decr(performanceIdKey, Math.abs(buyCount));
break;
}
}
}
} else {
redisUtil.decr(performanceIdKey, Math.abs(buyCount));
}
} }
} }
// 获取 用户维度 演出购买数量 // 获取 用户维度 演出购买数量
public int getUserPBuyCount(String userId, String performanceId) { public int getUserPBuyCount(String userId, String performanceId) {
try { try {
...@@ -387,6 +339,61 @@ public class DataUtils { ...@@ -387,6 +339,61 @@ public class DataUtils {
} catch (Exception e) { } catch (Exception e) {
return 0; return 0;
} }
// if (buyCount > 0) {
// redisUtil.incr(ticketIdKey, buyCount);
// if (1 == ticketType) {
// int count = 0;
// for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
// String item = allTicketId.get(useTime).get(i);
// if (allTicketId.get(useTime).size() == 1) {
// redisUtil.incr(performanceIdKey, buyCount);
// break;
// }
// if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
// }
// if (i == 0) {
// count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
// } else {
// if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.incr(performanceIdKey, buyCount);
// break;
// }
// }
// }
// } else {
// System.out.println("BUY_COUNT = "+buyCount);
// redisUtil.incr(performanceIdKey, buyCount);
// for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
// String item = allTicketId.get(useTime).get(i);
// redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
// }
// }
// } else {
// redisUtil.decr(ticketIdKey, Math.abs(buyCount));
// if (1 == ticketType) {
// int count = 0;
// for (int i = 0; i < allTicketId.get(useTime).size(); i++) {
// String item = allTicketId.get(useTime).get(i);
// if (allTicketId.get(useTime).size() == 1) {
// redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// break;
// }
// if (null == redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.set(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item, 0);
// }
// if (i == 0) {
// count = (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item);
// } else {
// if (count != (int) redisUtil.get(redisKey + ":" + KylinRedisConst.TICKET_ID + ":" + item)) {
// redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// break;
// }
// }
// }
// } else {
// redisUtil.decr(performanceIdKey, Math.abs(buyCount));
// }
} }
// 获取 用户维度 票种购买数量 // 获取 用户维度 票种购买数量
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
20013=已超过快递票截止时间 20013=已超过快递票截止时间
20014=快递票未填写收货地址 20014=快递票未填写收货地址
20015=入场人数量错误 20015=入场人数量错误
20016=该票种已售罄 20016=库存不足
20017=年龄不符合 20017=年龄不符合
20018=下单失败 20018=下单失败
......
kylin_order_ticket_entities.updateStatusByStation=UPDATE kylin_order_ticket_status SET `status`=?, updated_at=?, checked_at=?, check_type=?, checkUserId=? WHERE order_ticket_entities_id =? kylin_order_ticket_entities.updateStatusByStation=UPDATE kylin_order_ticket_entities SET `status`=?,check_client=?,updated_at=? WHERE order_ticket_entities_id=?
# ------------------------缺票登记(不用考虑并发)---------------------------- # ------------------------缺票登记(不用考虑并发)----------------------------
kylin_lack_register.insert=INSERT INTO `kylin_lack_registers`(`lack_registers_id` ,`performance_id` ,`ticket_id` ,`user_id` ,`user_name` ,`user_mobile` ,`send_status` ,`ip_address` ,`created_at`)VALUES(? ,? ,? ,? ,? ,? ,? ,? ,?); kylin_lack_register.insert=INSERT INTO `kylin_lack_registers`(`lack_registers_id` ,`performance_id` ,`ticket_id` ,`user_id` ,`user_name` ,`user_mobile` ,`send_status` ,`ip_address` ,`created_at`)VALUES(? ,? ,? ,? ,? ,? ,? ,? ,?);
......
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