| | |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | |
| | | import lombok.Data; |
| | | import org.apache.http.HttpResponse; |
| | | import org.apache.http.client.config.RequestConfig; |
| | | import org.apache.http.util.EntityUtils; |
| | |
| | | private static final String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlW2RMACojdqTa8H+j6411Lm5UipGXXbQiswq50rUflwjTj843zNVaVpk8uJmbdmtUBJlmblgBS/a31O4L4LrHB8WxJ+w0f9DBNTq9T6b80MiAVnU/3gXK365DmbzPWS5pR9wEgJVHnfOFUbsB5AVFHV0m9hUZcPv7xveuEp3BEoD5smaDJByR+KgFw0Q0JgINhhE6bsEa3UgJ198af269LtQ5HJl1TWLI8aeqW14HrxyADIt49NB9KZ8MOdKP+66HWcrXlipKFHtccy3dff72DqPmFdESoXfLXKZyhU5w9v4Q5F6UoAGTPwl9KQwikTobNeJ/7su7X3AB6+C14J4sQIDAQAB"; |
| | | |
| | | private static final ObjectMapper objectMapper = new ObjectMapper(); |
| | | |
| | | |
| | | @Override |
| | | public List<AuctionSalesroom> getAuctionBidRecordList(AuctionSalesroomDTO ationSalesroomGoodsDTO) { |
| | |
| | | R<SysUser> sysUserR = sysUserClient.queryUserByPhone(appMiniLoginDto.getPhone()); |
| | | SysUser data = sysUserR.getData(); |
| | | appMiniLoginVo.setSysUser(data); |
| | | appMiniLoginVo.setPhone(appMiniLoginDto.getAuth_code()); |
| | | appMiniLoginVo.setPhone(appMiniLoginDto.getPhone()); |
| | | return appMiniLoginVo; |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper2=Wrappers.lambdaQuery(); |
| | | wrapper2.eq(AuctionBidRecord::getAuctionSalesroomId,bidVO.getAuctionSalesroomId()); |
| | | wrapper2.eq(AuctionBidRecord::getTargetId,bidVO.getTargetId()); |
| | | wrapper2.eq(AuctionBidRecord::getDelFlag,0); |
| | | wrapper2.orderByDesc(AuctionBidRecord::getLastBidAmount); |
| | | AuctionBidRecord one2 = auctionBidRecordService.getOne(wrapper1); |
| | | |
| | | Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | map.put("notification_type", NotificationTypeConstant.AUCTION_SALESROOM); |
| | | map.put("auctionSalesroomId", bidVO.getAuctionSalesroomId()); |
| | | map.put("byId", byId.getStatus()); |
| | | map.put("lastBidAmount",one2.getLastBidAmount()); |
| | | map.put("message_type", "start"); |
| | | String msg = null; |
| | | try { |
| | | msg = objectMapper.writeValueAsString(map); |
| | | } catch (JsonProcessingException e) { |
| | | } |
| | | String finalMsg = msg; |
| | | Thread socketSender=new Thread(()->{ |
| | | try { |
| | | Thread.sleep(1000);//先休眠1秒 |
| | | WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.MEMBER.getCode(), finalMsg); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | }else { |
| | | AuctionGoods byId = auctionGoodsService.getById(bidVO.getTargetId()); |
| | | if (byId.getStartingPrice().doubleValue()>bidVO.getLastBidAmount().doubleValue()){ |
| | |
| | | one.setLastBidTime(LocalDateTime.now()); |
| | | one.setBidCount(one.getBidCount()+1); |
| | | auctionBidRecordService.updateById(one); |
| | | |
| | | |
| | | }else{ |
| | | one=new AuctionBidRecord(); |
| | | one.setAuctionSalesroomId(bidVO.getAuctionSalesroomId()); |
| | |
| | | one.setLastBidAmount(bidVO.getLastBidAmount()); |
| | | auctionBidRecordService.save(one); |
| | | } |
| | | |
| | | LambdaQueryWrapper<AuctionBidRecord> wrapper2=Wrappers.lambdaQuery(); |
| | | wrapper2.eq(AuctionBidRecord::getAuctionSalesroomId,bidVO.getAuctionSalesroomId()); |
| | | wrapper2.eq(AuctionBidRecord::getTargetId,bidVO.getTargetId()); |
| | | wrapper2.eq(AuctionBidRecord::getDelFlag,0); |
| | | wrapper2.orderByDesc(AuctionBidRecord::getLastBidAmount); |
| | | AuctionBidRecord one2 = auctionBidRecordService.getOne(wrapper1); |
| | | |
| | | Map<String, Object> map = new ConcurrentHashMap<>(); |
| | | map.put("notification_type", NotificationTypeConstant.AUCTION_SALESROOM); |
| | | map.put("auctionSalesroomId", bidVO.getAuctionSalesroomId()); |
| | | map.put("byId", byId.getStartStatus()); |
| | | map.put("lastBidAmount",one2.getLastBidAmount()); |
| | | map.put("message_type", "start"); |
| | | String msg = null; |
| | | try { |
| | | msg = objectMapper.writeValueAsString(map); |
| | | } catch (JsonProcessingException e) { |
| | | } |
| | | String finalMsg = msg; |
| | | Thread socketSender=new Thread(()->{ |
| | | try { |
| | | Thread.sleep(1000);//先休眠1秒 |
| | | WebSocketUsers.sendMessageToUsersByType(ClientTypeEnum.MEMBER.getCode(), finalMsg); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |