| | |
| | | |
| | | import com.dsh.activity.entity.THuiminRecord; |
| | | import com.dsh.activity.entity.TPayHuimin; |
| | | import com.dsh.activity.entity.VipDetail; |
| | | import com.dsh.activity.feignclient.other.SiteClient; |
| | | import com.dsh.activity.feignclient.other.StoreClient; |
| | | import com.dsh.activity.feignclient.other.model.Site; |
| | | import com.dsh.activity.feignclient.other.model.Store; |
| | | import com.dsh.activity.service.*; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 硬件方调用 存储玩湃惠民卡使用记录 |
| | |
| | | private HuiminRecordService huiminRecordService; |
| | | @Resource |
| | | private PayHuiminService payHuiminService; |
| | | @Resource |
| | | private VipDetailService vipDetailService; |
| | | @Resource |
| | | private SiteClient siteClient; |
| | | @Resource |
| | | private StoreClient storeClient; |
| | | /** |
| | | * 硬件开门后回调 存储玩湃惠民卡使用记录 |
| | | */ |
| | |
| | | huiminRecordService.save(huiminRecord); |
| | | } |
| | | } |
| | | /** |
| | | * 硬件开门后回调 存储会员使用明细 |
| | | */ |
| | | @PostMapping("/recordVipDetail") |
| | | public void recordVipDetail(Integer vipDetailId,Integer rid,Integer sid) { |
| | | System.err.println("硬件开门后回调 存储会员卡门票权益使用记录"); |
| | | System.err.println("vipDetailId:"+vipDetailId); |
| | | System.err.println("rid:"+rid); |
| | | System.err.println("sid:"+sid); |
| | | VipDetail vipDetailServiceById = vipDetailService.getById(vipDetailId); |
| | | if (vipDetailServiceById!=null){ |
| | | Site site = siteClient.querySiteById(rid); |
| | | if (site!=null){ |
| | | List<Store> stores = storeClient.queryStoreByIds(Arrays.asList(rid)); |
| | | if (!stores.isEmpty()){ |
| | | Store store = stores.get(0); |
| | | vipDetailServiceById.setOperatorId(store.getOperatorId()); |
| | | } |
| | | } |
| | | // 根据场地id查询运营商id |
| | | vipDetailServiceById.setUseSiteId(rid); |
| | | vipDetailServiceById.setUseStoreId(sid); |
| | | vipDetailServiceById.setStatus(2); |
| | | vipDetailServiceById.setStartTime(new Date()); |
| | | vipDetailServiceById.setEndTime(new Date()); |
| | | vipDetailService.updateById(vipDetailServiceById); |
| | | } |
| | | |
| | | } |
| | | } |