xhxu 5 лет назад
Родитель
Сommit
a9aa6c1409
4 измененных файлов: 44 добавлений и 1 удалений
  1. +4
    -0
      mallinkService/src/main/java/com/iformall/domain/po/tt/TtCoupon.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/service/tt/TtOrderService.java
  3. +15
    -0
      mallinkService/src/main/java/com/iformall/service/tt/impl/TtOrderServiceImpl.java
  4. +23
    -1
      mallinkTTCApi/src/main/java/com/iformall/controller/TtCouponController.java

+ 4
- 0
mallinkService/src/main/java/com/iformall/domain/po/tt/TtCoupon.java Просмотреть файл

@@ -141,6 +141,10 @@ public class TtCoupon extends TenantEntity {
@TableField(exist = false)
private List<TtCoupon> columnCoupons;

@TableField(exist = false)
@io.swagger.annotations.ApiModelProperty(value="是否可观看",name="view")
private boolean view;

@TableField(exist = false)
@io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams")
private Map<String, Object> flowParams;


+ 2
- 0
mallinkService/src/main/java/com/iformall/service/tt/TtOrderService.java Просмотреть файл

@@ -29,4 +29,6 @@ public interface TtOrderService {
ResultData createPay(TenantEntity tenantEntity,Long orderId, Long memberId, WxAppinfo appinfo);

ResultData updateOrderStatus(TenantEntity tenantInfo, Long orderId, Long memberId, WxAppinfo cAppInfo);

boolean isByMember(Long memberId, Long id);
}

+ 15
- 0
mallinkService/src/main/java/com/iformall/service/tt/impl/TtOrderServiceImpl.java Просмотреть файл

@@ -313,4 +313,19 @@ public class TtOrderServiceImpl implements TtOrderService {
return new ResultData();
}

@Override
public boolean isByMember(Long memberId, Long id) {
TtOrder orderQ = new TtOrder();
orderQ.setCUserId(memberId);
orderQ.setProductId(id);
List<Integer> statuss = new ArrayList<>();
statuss.add(EnumTtOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode());
orderQ.setStatusS(statuss);
int listCount = ttOrderMapper.findListCount(orderQ);
if(listCount > 0){
return true;
}
return false;
}

}

+ 23
- 1
mallinkTTCApi/src/main/java/com/iformall/controller/TtCouponController.java Просмотреть файл

@@ -5,9 +5,11 @@ import com.iformall.common.ResultData;
import com.iformall.domain.po.WxMerchant;
import com.iformall.domain.po.tt.TtCoupon;
import com.iformall.enums.EnumTtCouponStatus;
import com.iformall.enums.EnumYesOrNo;
import com.iformall.exception.MallinkException;
import com.iformall.service.WxMerchantService;
import com.iformall.service.tt.TtCouponService;
import com.iformall.service.tt.TtOrderService;
import com.iformall.video.VideoFactory;
import com.iformall.video.entity.VideUploadResult;
import io.swagger.annotations.Api;
@@ -32,6 +34,9 @@ public class TtCouponController extends BaseController {
@Autowired
private WxMerchantService wxMerchantService;

@Autowired
private TtOrderService ttOrderService;

@Autowired
private VideoFactory videoFactory;

@@ -58,8 +63,25 @@ public class TtCouponController extends BaseController {
if (id == null) {
return new ResultData(ResultData.ERROR, "缺少id");
}
TtCoupon detail = ttCouponService.detail(id);
if(detail == null){
new ResultData();
}
if(detail.getIsPayment().equals(EnumYesOrNo.YES.getCode())){
try {
if(ttOrderService.isByMember(getMemberId(),id)){
detail.setView(true);
}else{
detail.setView(false);
}
} catch (MallinkException e) {
detail.setView(false);
}
}else{
detail.setView(true);
}
ttCouponService.addSeeCount(id);
return new ResultData(ttCouponService.detail(id));
return new ResultData(detail);
}

@GetMapping(value = "/videoDetial")


Загрузка…
Отмена
Сохранить