Explorar o código

fix midjourney收货地址取消

zoujiajian %!s(int64=3) %!d(string=hai) anos
pai
achega
205db6e832

+ 10 - 2
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -356,7 +356,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 		}
 		this.saveOrUpdate(orderDon);
 
-		if (Constant.realGoodsType.contains(goodsDon.getType())) {
+		if (Constant.realGoodsType.contains(goodsDon.getType()) && !goodsDon.getId().equals(27l)) {
 			saveTransport(payRequest.getAddressId(), orderDon.getId());
 		}
 		if (isNew) {
@@ -2160,6 +2160,14 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 	 */
 	private void sendMidjourneyTicketIfCourse(Long userId) {
 		Optional.ofNullable(goodsDonSkuMapper.selectById(185))
-				.ifPresent(sku -> exchangeCodeService.getRelationNoOrder(sku, userId));
+				.ifPresent(sku -> {
+					GroupsRelation relation = exchangeCodeService.getRelationNoOrder(sku, userId);
+					if (relation.getExpiryTime() == null || relation.getStartTime() == null) {
+						DateTime now = DateTime.now();
+						relation.setStartTime(now);
+						relation.setExpiryTime(DateUtil.offsetMonth(now, sku.getMonths() * 1));
+						groupsRelationMapper.updateById(relation);
+					}
+				});
 	}
 }