|
@@ -152,6 +152,7 @@ public class OrderServiceImpl implements OrderService {
|
|
|
orderShareCode.setExpiredTime(calendar.getTime());
|
|
|
orderShareCode.setDelFlag("0");
|
|
|
orderMapper.updateCode(orderShareCode);
|
|
|
+ orderMapper.deleteCodeRecord(orderID);
|
|
|
return String.valueOf(shareCode);
|
|
|
} else {
|
|
|
OrderShareCode code = new OrderShareCode();
|
|
@@ -181,7 +182,7 @@ public class OrderServiceImpl implements OrderService {
|
|
|
if (orderShareCode == null) return model.error("该订单没有生成分享码");
|
|
|
CmOrder order = orderMapper.findOrder(orderID);
|
|
|
if (order == null) return model.error("该订单已删除");
|
|
|
- if (orderShareCode.getShareCode().equals(shareCode)) {
|
|
|
+ if (orderShareCode.getShareCode().equals(shareCode) && orderShareCode.getExpiredTime().compareTo(new Date()) == 1) {
|
|
|
CmMallShareCodeRecord codeRecord = new CmMallShareCodeRecord();
|
|
|
codeRecord.setOpenid(openid);
|
|
|
codeRecord.setAddTime(new Date());
|
|
@@ -190,7 +191,7 @@ public class OrderServiceImpl implements OrderService {
|
|
|
codeRecord.setShareCodeId(orderShareCode.getId());
|
|
|
orderMapper.saveShareCodeRecord(codeRecord);
|
|
|
return model.success();
|
|
|
- } else if (orderShareCode.getExpiredTime().compareTo(new Date()) == -1) {
|
|
|
+ } else if (orderShareCode.getShareCode().equals(shareCode) && orderShareCode.getExpiredTime().compareTo(new Date()) != 1) {
|
|
|
return model.error("分享码失效");
|
|
|
} else {
|
|
|
return model.error("分享码错误");
|
|
@@ -225,6 +226,14 @@ public class OrderServiceImpl implements OrderService {
|
|
|
OrderInvoice orderInvoice = orderMapper.getOrderInvoice(orderID);
|
|
|
//支付记录
|
|
|
List<CmDiscernReceipt> discernReceiptList = orderMapper.findDiscernReceipt(orderID);
|
|
|
+ if (discernReceiptList != null && discernReceiptList.size() > 0) {
|
|
|
+ Double receiptAmount = 0d;
|
|
|
+ for (CmDiscernReceipt discernReceipt : discernReceiptList) {
|
|
|
+ receiptAmount += discernReceipt.getReceiptAmount();
|
|
|
+ }
|
|
|
+ //支付总金额
|
|
|
+ map.put("receiptAmount", receiptAmount);
|
|
|
+ }
|
|
|
//退款记录
|
|
|
List<CmReturnedPurchase> returnedPurchaseList = orderMapper.findReturnedPurchase(order.getOrderID());
|
|
|
//客服热线号码
|