16 files added
17 files modified
| | |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.enumerates.ProductEnum; |
| | | import cc.mrbird.febs.mall.dto.AdminMallProductNftDto; |
| | | import cc.mrbird.febs.mall.dto.AdminPickSellRecordDtoDto; |
| | | import cc.mrbird.febs.mall.dto.MallNewsInfoDto; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.MallProductNftMapper; |
| | | import cc.mrbird.febs.mall.service.IMallNewsInfoService; |
| | | import cc.mrbird.febs.mall.vo.AdminMallProductNftVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallProductSellPickVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 用户NFT提现-匹配提现用户列表 |
| | | * @return |
| | | */ |
| | | @GetMapping(value = "findSellList") |
| | | public FebsResponse findSellList() { |
| | | List<AdminMallProductSellPickVo> categories = mallNewsInfoService.findSellList(); |
| | | return new FebsResponse().success().data(categories); |
| | | } |
| | | |
| | | /** |
| | | * 用户NFT提现-手动分配 |
| | | */ |
| | | @PostMapping("pickSellRecord") |
| | | @ControllerEndpoint(operation = "用户NFT提现-手动分配", exceptionMessage = "操作失败") |
| | | public FebsResponse pickSellRecord(@Valid AdminPickSellRecordDtoDto pickSellRecordDto) { |
| | | return mallNewsInfoService.pickSellRecord(pickSellRecordDto); |
| | | } |
| | | |
| | | /** |
| | | * 新闻中心-列表 |
| | | * @param mallNewsInfo |
| | | * @param request |
| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.entity.MallNewsInfo; |
| | | import cc.mrbird.febs.mall.service.IApiMallNewsService; |
| | | import cc.mrbird.febs.mall.service.IApiMallProductService; |
| | | import cc.mrbird.febs.mall.vo.NewsListVo; |
| | | import cc.mrbird.febs.mall.vo.OrderListVo; |
| | | import cc.mrbird.febs.mall.vo.ApiOrderBuyInfoVo; |
| | | import cc.mrbird.febs.mall.vo.ApiOrderSellInfoVo; |
| | | import cc.mrbird.febs.mall.vo.ApiOrderListVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | |
| | | public FebsResponse productNFTList() { |
| | | return new FebsResponse().success().data(iApiMallProductService.productNFTList()); |
| | | } |
| | | |
| | | @ApiOperation(value = "预约", notes = "预约") |
| | | @PostMapping(value = "/createNFT") |
| | | public FebsResponse createNFT(@RequestBody @Valid ApiCreateNFTDto createNFTDto) { |
| | | return iApiMallProductService.createNFT(createNFTDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单管理-列表", notes = "订单管理-列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiOrderListVo.class) |
| | | }) |
| | | @PostMapping(value = "/orderList") |
| | | public FebsResponse orderList(@RequestBody @Valid ApiOrderListDto apiOrderListDto) { |
| | | return iApiMallProductService.orderList(apiOrderListDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单管理-查看提现详情", notes = "订单管理-查看提现详情") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiOrderSellInfoVo.class) |
| | | }) |
| | | @PostMapping(value = "/orderSell") |
| | | public FebsResponse orderSell(@RequestBody @Valid ApiOrderSellInfoDto apiOrderSellInfoDto) { |
| | | return iApiMallProductService.orderSell(apiOrderSellInfoDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单管理-查看预约详情", notes = "订单管理-查看预约详情") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiOrderBuyInfoVo.class) |
| | | }) |
| | | @PostMapping(value = "/orderBuy") |
| | | public FebsResponse orderBuy(@RequestBody @Valid ApiOrderBuyInfoDto apiOrderBuyInfoDto) { |
| | | return iApiMallProductService.orderBuy(apiOrderBuyInfoDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "FCM提现", notes = "FCM提现") |
| | | @PostMapping(value = "/outFcm") |
| | | public FebsResponse outFcm(@RequestBody @Valid ApiOutFcmDto outFcmDto) { |
| | | return iApiMallProductService.outFcm(outFcmDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "NFT提现", notes = "NFT提现") |
| | | @PostMapping(value = "/outNFT") |
| | | public FebsResponse outNFT(@RequestBody @Valid ApiOutNFTDto outNFTDto) { |
| | |
| | | import cc.mrbird.febs.common.utils.FebsUtil; |
| | | import cc.mrbird.febs.mall.entity.MallNewsCategory; |
| | | import cc.mrbird.febs.mall.entity.MallNewsInfo; |
| | | import cc.mrbird.febs.mall.entity.MallProductBuy; |
| | | import cc.mrbird.febs.mall.entity.MallProductNft; |
| | | import cc.mrbird.febs.mall.mapper.MallProductBuyMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallProductNftMapper; |
| | | import cc.mrbird.febs.mall.service.IMallNewsInfoService; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | |
| | | private final IMallNewsInfoService mallNewsInfoService; |
| | | private final MallProductNftMapper mallProductNftMapper; |
| | | private final MallProductBuyMapper mallProductBuyMapper; |
| | | |
| | | /** |
| | | * NFT预约产品 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 用户NFT提现-手动分配 |
| | | * @return |
| | | */ |
| | | @GetMapping("productSellPick/{id}") |
| | | @RequiresPermissions("productSellPick:update") |
| | | public String productSellPick(@PathVariable long id, Model model) { |
| | | MallProductBuy mallProductBuy = mallProductBuyMapper.selectById(id); |
| | | model.addAttribute("mallProductBuy", mallProductBuy); |
| | | return FebsUtil.view("modules/news/productSellPick"); |
| | | } |
| | | |
| | | /** |
| | | * 新闻中心-列表 |
| | | * @return |
| | | */ |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class AdminPickSellRecordDtoDto { |
| | | |
| | | private Long productSellId; |
| | | private Long id; |
| | | private String pickNftCnt; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiOrderBuyInfoDto", description = "参数接收类") |
| | | public class ApiOrderBuyInfoDto { |
| | | |
| | | @NotNull(message = "类型参数不能为空") |
| | | private Long id; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiOrderListDto", description = "参数接收类") |
| | | public class ApiOrderListDto { |
| | | |
| | | @ApiModelProperty(value = "一页数量", example = "10") |
| | | private Integer pageSize; |
| | | |
| | | @ApiModelProperty(value = "第几页", example = "1") |
| | | private Integer pageNum; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long memberId; |
| | | |
| | | @NotNull(message = "类型参数不能为空") |
| | | @ApiModelProperty(value = "类型:1:提现(卖单), 2:预约(买单)", example = "1") |
| | | private Integer orderType; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiOrderSellInfoDto", description = "参数接收类") |
| | | public class ApiOrderSellInfoDto { |
| | | |
| | | @NotNull(message = "类型参数不能为空") |
| | | private Long id; |
| | | |
| | | } |
| | |
| | | package cc.mrbird.febs.mall.entity; |
| | | |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | |
| | | public class MallProductBuy extends BaseEntity { |
| | | |
| | | private Long memberId;// |
| | | private String orderNo; |
| | | private Long sellId;//出售ID |
| | | private Long productNftId;//预约NFT编码 |
| | | private Long productNftId;//预约NFTID |
| | | private int state;//预约状态 0:失败 1:进行中 2:超时 3:已完成 |
| | | private int mateState;//匹配状态0:失败 1:匹配中 2:待支付 3:已支付 4:对方已确认 5:已完成 |
| | | private BigDecimal nftTotal;//nft预约额度 |
| | | private BigDecimal nftAva;//nft分配额度 |
| | | private Date orderTime;//匹配时间 |
| | | private Date payTime;//支付时间 |
| | | |
| | | @TableField(exist = false) |
| | | private String accountLogin; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.entity; |
| | | |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("mall_product_buy_record") |
| | | public class MallProductBuyRecord extends BaseEntity { |
| | | |
| | | private Long memberId;// |
| | | private Long buyId;// |
| | | private Long sellRecordId;// |
| | | private BigDecimal pickNftCnt;//分配额度、支付金额 |
| | | private Integer state;//匹配状态0:失败 1:匹配中 2:待支付 3:已支付 4:对方已确认 5:已完成 |
| | | private Date orderTime;//匹配时间 |
| | | private Date payTime;//支付时间 |
| | | private String nftImg;//支付凭证 |
| | | private Integer type;//支付类型 1:微信 2:支付宝 3:银行转账 4:USDT转账 |
| | | } |
| | |
| | | package cc.mrbird.febs.mall.entity; |
| | | |
| | | import cc.mrbird.febs.common.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | |
| | | public class MallProductSell extends BaseEntity { |
| | | |
| | | private Long memberId;// |
| | | private String orderNo; |
| | | private BigDecimal nftTotal;//动态NFT总数 |
| | | private BigDecimal nftCnt;//实际提现数量 |
| | | private BigDecimal nftCntAva;//剩余数量 |
| | | private BigDecimal nftFee;//NFT手续费 |
| | | private BigDecimal fcmFee;//代币手续费 |
| | | private Integer state;//预约状态 0:失败 1:进行中 2:超时 3:已完成 |
| | | |
| | | @TableField(exist = false) |
| | | private String accountLogin; |
| | | } |
| | |
| | | package cc.mrbird.febs.mall.mapper; |
| | | |
| | | import cc.mrbird.febs.mall.dto.ApiOrderListDto; |
| | | import cc.mrbird.febs.mall.entity.MallProductBuy; |
| | | import cc.mrbird.febs.mall.vo.ApiOrderBuyInfoVo; |
| | | import cc.mrbird.febs.mall.vo.ApiOrderListVo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface MallProductBuyMapper extends BaseMapper<MallProductBuy> { |
| | |
| | | @Param("productNFTId")Long productNFTId, |
| | | @Param("state")Integer state, |
| | | @Param("mateState")Integer mateState); |
| | | |
| | | IPage<ApiOrderListVo> selectListInPage(IPage<ApiOrderListVo> page, @Param("record")ApiOrderListDto apiOrderListDto); |
| | | |
| | | ApiOrderBuyInfoVo selectBuyById(@Param("id")Long productBuyId); |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.mapper; |
| | | |
| | | import cc.mrbird.febs.mall.entity.MallProductBuyRecord; |
| | | import cc.mrbird.febs.mall.vo.ApiOrderBuyRecordInfoVo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface MallProductBuyRecordMapper extends BaseMapper<MallProductBuyRecord> { |
| | | |
| | | List<ApiOrderBuyRecordInfoVo> selectByBuyId(@Param("productBuyId")Long productBuyId); |
| | | |
| | | } |
| | |
| | | import cc.mrbird.febs.mall.entity.MallProductBuy; |
| | | import cc.mrbird.febs.mall.entity.MallProductNft; |
| | | import cc.mrbird.febs.mall.entity.MallProductSell; |
| | | import cc.mrbird.febs.mall.vo.AdminMallProductBuyVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallProductNftVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallProductSellVo; |
| | | import cc.mrbird.febs.mall.vo.ApiMallProductNftVo; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | |
| | | IPage<AdminMallProductSellVo> getSellList(Page<AdminMallProductSellVo> page, @Param("record")MallProductSell mallProductSell); |
| | | |
| | | List<AdminMallProductSellPickVo> selectProductSellByState(@Param("state")int value); |
| | | } |
| | |
| | | package cc.mrbird.febs.mall.mapper; |
| | | |
| | | import cc.mrbird.febs.mall.dto.ApiOrderListDto; |
| | | import cc.mrbird.febs.mall.entity.MallProductSell; |
| | | import cc.mrbird.febs.mall.vo.ApiOrderListVo; |
| | | import cc.mrbird.febs.mall.vo.ApiOrderSellInfoVo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | public interface MallProductSellMapper extends BaseMapper<MallProductSell> { |
| | | |
| | | IPage<ApiOrderListVo> selectListInPage(IPage<ApiOrderListVo> page, @Param("record")ApiOrderListDto apiOrderListDto); |
| | | |
| | | ApiOrderSellInfoVo selectSellInfoById(@Param("id")Long productSellId); |
| | | } |
| | |
| | | package cc.mrbird.febs.mall.mapper; |
| | | |
| | | import cc.mrbird.febs.mall.entity.MallProductSellRecord; |
| | | import cc.mrbird.febs.mall.vo.ApiOrderSellRecordInfoVo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface MallProductSellRecordMapper extends BaseMapper<MallProductSellRecord> { |
| | | |
| | | List<ApiOrderSellRecordInfoVo> selectBySellId(@Param("productSellId")Long productSellId); |
| | | |
| | | } |
| | |
| | | package cc.mrbird.febs.mall.service; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.mall.dto.ApiCreateNFTDto; |
| | | import cc.mrbird.febs.mall.dto.ApiOutFcmDto; |
| | | import cc.mrbird.febs.mall.dto.ApiOutNFTDto; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.entity.MallNewsCategory; |
| | | import cc.mrbird.febs.mall.entity.MallProductNft; |
| | | import cc.mrbird.febs.mall.vo.ApiMallProductNftVo; |
| | |
| | | FebsResponse outFcm(ApiOutFcmDto outFcmDto); |
| | | |
| | | FebsResponse outNFT(ApiOutNFTDto outNFTDto); |
| | | |
| | | FebsResponse orderList(ApiOrderListDto apiOrderListDto); |
| | | |
| | | FebsResponse orderSell(ApiOrderSellInfoDto apiOrderSellInfoDto); |
| | | |
| | | FebsResponse orderBuy(ApiOrderBuyInfoDto apiOrderBuyInfoDto); |
| | | } |
| | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.mall.dto.AdminMallProductNftDto; |
| | | import cc.mrbird.febs.mall.dto.AdminPickSellRecordDtoDto; |
| | | import cc.mrbird.febs.mall.dto.MallNewsInfoDto; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.vo.AdminMallNewsInfoVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallProductBuyVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallProductNftVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallProductSellVo; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | |
| | | IPage<AdminMallProductBuyVo> getBuyList(MallProductBuy mallProductBuy, QueryRequest request); |
| | | |
| | | IPage<AdminMallProductSellVo> getSellList(MallProductSell mallProductSell, QueryRequest request); |
| | | |
| | | List<AdminMallProductSellPickVo> findSellList(); |
| | | |
| | | FebsResponse pickSellRecord(AdminPickSellRecordDtoDto pickSellRecordDto); |
| | | } |
| | |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.utils.LoginUserUtil; |
| | | import cc.mrbird.febs.common.utils.MallUtils; |
| | | import cc.mrbird.febs.mall.dto.ApiCreateNFTDto; |
| | | import cc.mrbird.febs.mall.dto.ApiOutFcmDto; |
| | | import cc.mrbird.febs.mall.dto.ApiOutNFTDto; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cc.mrbird.febs.mall.service.IApiMallProductService; |
| | | import cc.mrbird.febs.mall.service.IMallMoneyFlowService; |
| | | import cc.mrbird.febs.mall.vo.ApiMallProductNftVo; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import cc.mrbird.febs.rabbit.producter.AgentProducer; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | |
| | | private final AgentProducer agentProducer; |
| | | private final MallProductSellMapper mallProductSellMapper; |
| | | private final MallProductSellRecordMapper mallProductSellRecordMapper; |
| | | private final MallProductBuyRecordMapper mallProductBuyRecordMapper; |
| | | |
| | | @Override |
| | | public List<ApiMallProductNftVo> productNFTList() { |
| | |
| | | || priceToken.compareTo(mallMemberAmount.getTokenAva()) > 0){ |
| | | throw new FebsException("余额不足"); |
| | | } |
| | | |
| | | String orderNo = MallUtils.getOrderNum("YY"); |
| | | mallProductBuy = new MallProductBuy(); |
| | | mallProductBuy.setMemberId(memberId); |
| | | mallProductBuy.setOrderNo(orderNo); |
| | | mallProductBuy.setProductNftId(mallProductNft.getId()); |
| | | mallProductBuy.setState(ProductEnum.PRODUCT_BUY_ON_GOING.getValue()); |
| | | mallProductBuy.setMateState(ProductEnum.PRODUCT_MATE_STATE_ON_GOING.getValue()); |
| | |
| | | mallMemberAmount.setTokenAva(mallMemberAmount.getTokenAva().subtract(priceToken)); |
| | | mallMemberAmount.setTokenFrozen(mallMemberAmount.getTokenFrozen().add(priceToken)); |
| | | mallMemberAmountMapper.updateTokenAvaAndTokenFrozenById(mallMemberAmount); |
| | | |
| | | String orderNo = MallUtils.getOrderNum("YY"); |
| | | iMallMoneyFlowService.addMoneyFlow( |
| | | memberId, |
| | | priceToken.negate(), |
| | |
| | | BigDecimal fcmPrice = ObjectUtil.isEmpty(fcmPriceDic) ? new BigDecimal(2) : new BigDecimal(fcmPriceDic.getValue()); |
| | | BigDecimal fcmFeeCnt = nftFee.divide(fcmPrice, 2, BigDecimal.ROUND_DOWN); |
| | | |
| | | String orderNo = MallUtils.getOrderNum("NFT"); |
| | | MallProductSell mallProductSell = new MallProductSell(); |
| | | mallProductSell.setMemberId(memberId); |
| | | mallProductSell.setOrderNo(orderNo); |
| | | mallProductSell.setNftTotal(nftCnt); |
| | | mallProductSell.setNftCnt(nftCntAva); |
| | | mallProductSell.setNftCntAva(nftCntAva); |
| | |
| | | |
| | | mallMemberAmount.setFrozenNft(mallMemberAmount.getFrozenNft().add(nftCntAva)); |
| | | mallMemberAmountMapper.updateFrozenNftById(mallMemberAmount); |
| | | String orderNo = MallUtils.getOrderNum("NFT"); |
| | | iMallMoneyFlowService.addMoneyFlow( |
| | | memberId, |
| | | nftCnt.negate(), |
| | |
| | | agentProducer.sendFcmNFTExchangeMsg(fcmFeeCnt.toString()); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse orderList(ApiOrderListDto apiOrderListDto) { |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | List<ApiOrderListVo> objects = new ArrayList<>(); |
| | | Integer orderType = apiOrderListDto.getOrderType(); |
| | | apiOrderListDto.setMemberId(memberId); |
| | | //买单 |
| | | if(2 == orderType){ |
| | | IPage<ApiOrderListVo> page = new Page<>(apiOrderListDto.getPageNum(), apiOrderListDto.getPageSize()); |
| | | IPage<ApiOrderListVo> apiOrderListVoIPageBuy = mallProductBuyMapper.selectListInPage(page, apiOrderListDto); |
| | | if(CollUtil.isNotEmpty(apiOrderListVoIPageBuy.getRecords())){ |
| | | for(ApiOrderListVo apiOrderListVo : apiOrderListVoIPageBuy.getRecords()){ |
| | | objects.add(apiOrderListVo); |
| | | } |
| | | } |
| | | } |
| | | //卖单 |
| | | if(1 == orderType){ |
| | | IPage<ApiOrderListVo> page = new Page<>(apiOrderListDto.getPageNum(), apiOrderListDto.getPageSize()); |
| | | IPage<ApiOrderListVo> apiOrderListVoIPageSell = mallProductSellMapper.selectListInPage(page, apiOrderListDto); |
| | | if(CollUtil.isNotEmpty(apiOrderListVoIPageSell.getRecords())){ |
| | | for(ApiOrderListVo apiOrderListVo : apiOrderListVoIPageSell.getRecords()){ |
| | | objects.add(apiOrderListVo); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return new FebsResponse().success().data(objects); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse orderSell(ApiOrderSellInfoDto apiOrderSellInfoDto) { |
| | | Long productSellId = apiOrderSellInfoDto.getId(); |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | ApiOrderSellInfoVo apiOrderSellInfoVo = mallProductSellMapper.selectSellInfoById(productSellId); |
| | | if(ObjectUtil.isEmpty(apiOrderSellInfoVo)){ |
| | | throw new FebsException("记录不存在"); |
| | | } |
| | | List<ApiOrderSellRecordInfoVo> apiOrderSellRecordInfoVos = mallProductSellRecordMapper.selectBySellId(productSellId); |
| | | if(CollUtil.isNotEmpty(apiOrderSellRecordInfoVos)){ |
| | | apiOrderSellInfoVo.setApiOrderSellRecordInfoVos(apiOrderSellRecordInfoVos); |
| | | } |
| | | return new FebsResponse().success().data(apiOrderSellInfoVo); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse orderBuy(ApiOrderBuyInfoDto apiOrderBuyInfoDto) { |
| | | Long productBuyId = apiOrderBuyInfoDto.getId(); |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | ApiOrderBuyInfoVo apiOrderBuyInfoVo = mallProductBuyMapper.selectBuyById(productBuyId); |
| | | if(ObjectUtil.isEmpty(apiOrderBuyInfoVo)){ |
| | | throw new FebsException("记录不存在"); |
| | | } |
| | | List<ApiOrderBuyRecordInfoVo> apiOrderBuyRecordInfoVos = mallProductBuyRecordMapper.selectByBuyId(productBuyId); |
| | | if(CollUtil.isNotEmpty(apiOrderBuyRecordInfoVos)){ |
| | | apiOrderBuyInfoVo.setApiOrderBuyRecordInfoVos(apiOrderBuyRecordInfoVos); |
| | | } |
| | | return new FebsResponse().success().data(apiOrderBuyInfoVo); |
| | | } |
| | | } |
| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.enumerates.ProductEnum; |
| | | import cc.mrbird.febs.mall.conversion.MallProductNftConversion; |
| | | import cc.mrbird.febs.mall.dto.AdminMallProductNftDto; |
| | | import cc.mrbird.febs.mall.dto.AdminPickSellRecordDtoDto; |
| | | import cc.mrbird.febs.mall.dto.MallNewsInfoDto; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.MallNewsCategoryMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallNewsInfoMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallProductNftMapper; |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cc.mrbird.febs.mall.service.IMallNewsInfoService; |
| | | import cc.mrbird.febs.mall.vo.AdminMallNewsInfoVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallProductBuyVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallProductNftVo; |
| | | import cc.mrbird.febs.mall.vo.AdminMallProductSellVo; |
| | | import cc.mrbird.febs.mall.vo.*; |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | |
| | | private final MallNewsCategoryMapper mallNewsCategoryMapper; |
| | | private final MallProductNftMapper mallProductNftMapper; |
| | | private final MallProductBuyMapper mallProductBuyMapper; |
| | | private final MallProductSellMapper mallProductSellMapper; |
| | | private final MallProductSellRecordMapper mallProductSellRecordMapper; |
| | | private final MallProductBuyRecordMapper mallProductBuyRecordMapper; |
| | | |
| | | @Override |
| | | public IPage<AdminMallNewsInfoVo> getNewInfoList(MallNewsInfo mallNewsInfo, QueryRequest request) { |
| | |
| | | IPage<AdminMallProductSellVo> adminMallProductSellVoIPage = mallProductNftMapper.getSellList(page, mallProductSell); |
| | | return adminMallProductSellVoIPage; |
| | | } |
| | | |
| | | @Override |
| | | public List<AdminMallProductSellPickVo> findSellList() { |
| | | List<AdminMallProductSellPickVo> list = mallProductNftMapper.selectProductSellByState(ProductEnum.PRODUCT_SELL_ON_GOING.getValue()); |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse pickSellRecord(AdminPickSellRecordDtoDto pickSellRecordDto) { |
| | | /** |
| | | * 买单条件是否满足 |
| | | * 卖单条件是否满足 |
| | | * 生成卖单子记录 |
| | | * 生成买单子记录 |
| | | * 更新卖单状态 |
| | | * 更新买单状态 |
| | | */ |
| | | Long productBuyId = pickSellRecordDto.getId(); |
| | | Long productSellId = pickSellRecordDto.getProductSellId(); |
| | | BigDecimal pickNftCnt = new BigDecimal(pickSellRecordDto.getPickNftCnt()); |
| | | //买单 |
| | | MallProductBuy mallProductBuy = mallProductBuyMapper.selectById(productBuyId); |
| | | int state = mallProductBuy.getState(); |
| | | if(ProductEnum.PRODUCT_BUY_ON_GOING.getValue() != state){ |
| | | return new FebsResponse().fail().message("预约状态不是进行中"); |
| | | } |
| | | BigDecimal nftAva = mallProductBuy.getNftAva(); |
| | | if(BigDecimal.ZERO.compareTo(pickNftCnt) >= 0){ |
| | | return new FebsResponse().fail().message("本次金额不能小于等于零"); |
| | | } |
| | | if(nftAva.compareTo(pickNftCnt) < 0){ |
| | | return new FebsResponse().fail().message("可分配不足"); |
| | | } |
| | | //卖单 |
| | | MallProductSell mallProductSell = mallProductSellMapper.selectById(productSellId); |
| | | BigDecimal nftCntAva = mallProductSell.getNftCntAva(); |
| | | if(ProductEnum.PRODUCT_SELL_ON_GOING.getValue() != mallProductSell.getState()){ |
| | | return new FebsResponse().fail().message("预约状态不是进行中"); |
| | | } |
| | | if(nftCntAva.compareTo(pickNftCnt) < 0){ |
| | | return new FebsResponse().fail().message("匹配提现剩余不足"); |
| | | } |
| | | DateTime orderTime = DateUtil.date(); |
| | | //生成卖单子记录 |
| | | MallProductSellRecord mallProductSellRecord = new MallProductSellRecord(); |
| | | mallProductSellRecord.setSellId(mallProductSell.getId()); |
| | | mallProductSellRecord.setMemberId(mallProductBuy.getMemberId()); |
| | | mallProductSellRecord.setOrderTime(orderTime); |
| | | mallProductSellRecord.setNftCnt(pickNftCnt); |
| | | mallProductSellRecord.setState(ProductEnum.PRODUCT_MATE_STATE_WAIT_PAY.getValue()); |
| | | mallProductSellRecordMapper.insert(mallProductSellRecord); |
| | | //生成买单子记录 |
| | | MallProductBuyRecord mallProductBuyRecord = new MallProductBuyRecord(); |
| | | mallProductBuyRecord.setBuyId(mallProductBuy.getId()); |
| | | mallProductBuyRecord.setMemberId(mallProductSell.getMemberId()); |
| | | mallProductBuyRecord.setSellRecordId(mallProductSellRecord.getId()); |
| | | mallProductBuyRecord.setPickNftCnt(pickNftCnt); |
| | | mallProductBuyRecord.setState(ProductEnum.PRODUCT_MATE_STATE_WAIT_PAY.getValue()); |
| | | mallProductBuyRecord.setOrderTime(orderTime); |
| | | mallProductBuyRecordMapper.insert(mallProductBuyRecord); |
| | | //更新卖单 |
| | | mallProductSell.setNftCntAva(mallProductSell.getNftCntAva().subtract(pickNftCnt)); |
| | | mallProductSellMapper.updateById(mallProductSell); |
| | | //更新买单 |
| | | mallProductBuy.setNftAva(mallProductBuy.getNftAva().subtract(pickNftCnt)); |
| | | mallProductBuyMapper.updateById(mallProductBuy); |
| | | return new FebsResponse().success(); |
| | | } |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "AdminMallProductSellPickVo", description = "信息返回类") |
| | | public class AdminMallProductSellPickVo { |
| | | |
| | | |
| | | private Long id;//编码 |
| | | private String name;//编码 |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiOrderBuyInfoVo", description = "信息返回类") |
| | | public class ApiOrderBuyInfoVo { |
| | | private Long id; |
| | | private String orderNo; |
| | | private int state;//预约状态 0:失败 1:进行中 2:超时 3:已完成 |
| | | private int mateState;//匹配状态0:失败 1:匹配中 2:待支付 3:已支付 4:对方已确认 5:已完成 |
| | | private BigDecimal nftTotal;//nft预约额度 |
| | | private BigDecimal nftAva;//nft分配额度 |
| | | private Date orderTime;//匹配时间 |
| | | private Date payTime;//支付时间 |
| | | private List<ApiOrderBuyRecordInfoVo> apiOrderBuyRecordInfoVos; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiOrderBuyRecordInfoVo", description = "信息返回类") |
| | | public class ApiOrderBuyRecordInfoVo { |
| | | private Long id;// |
| | | private String accountLogin;// |
| | | private BigDecimal pickNftCnt;//分配额度、支付金额 |
| | | private Integer state;//匹配状态0:失败 1:匹配中 2:待支付 3:已支付 4:对方已确认 5:已完成 |
| | | private Date orderTime;//匹配时间 |
| | | private Date payTime;//支付时间 |
| | | private String nftImg;//支付凭证 |
| | | private Integer type;//支付类型 1:微信 2:支付宝 3:银行转账 4:USDT转账 |
| | | |
| | | private String wxQrcode;//微信收款码 |
| | | private String aliQrcode;//支付宝收款码 |
| | | private String bankName;//真实姓名 |
| | | private String bankNo;//银行卡号 |
| | | private String bank;//开户行 |
| | | private String phone;//手机号 |
| | | private String usdtTongdao;//USDT通道类型: TRC20 BEP20 |
| | | private String usdtAddress;//USDT地址 |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiOrderListVo", description = "信息返回类") |
| | | public class ApiOrderListVo { |
| | | |
| | | @ApiModelProperty(value = "ID") |
| | | private Long id; |
| | | @ApiModelProperty(value = "状态 0:失败 1:进行中 2:超时 3:已完成") |
| | | private Integer state; |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String orderNo; |
| | | @ApiModelProperty(value = "类型:1:提现(卖单), 2:预约(买单)") |
| | | private String type; |
| | | @ApiModelProperty(value = "数量") |
| | | private BigDecimal nftTotal; |
| | | @ApiModelProperty(value = "时间") |
| | | private Date createdTime; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiOrderSellInfoVo", description = "信息返回类") |
| | | public class ApiOrderSellInfoVo { |
| | | private Long id; |
| | | private String orderNo; |
| | | private BigDecimal nftTotal;//动态NFT总数 |
| | | private BigDecimal nftCnt;//实际提现数量 |
| | | private BigDecimal nftCntAva;//剩余数量 |
| | | private BigDecimal nftFee;//NFT手续费 |
| | | private BigDecimal fcmFee;//代币手续费 |
| | | private Integer state;//预约状态 0:失败 1:进行中 2:超时 3:已完成 |
| | | private List<ApiOrderSellRecordInfoVo> apiOrderSellRecordInfoVos; |
| | | |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiOrderSellRecordInfoVo", description = "信息返回类") |
| | | public class ApiOrderSellRecordInfoVo { |
| | | private Long id; |
| | | private String accountLogin;// |
| | | private Date orderTime;//匹配时间 |
| | | private Date payTime;//支付时间 |
| | | private BigDecimal nftCnt;//支付数量 |
| | | private String nftImg;//支付凭证 |
| | | private Integer type;//支付类型 1:微信 2:支付宝 3:银行转账 4:USDT转账 |
| | | private Integer state;//匹配状态0:失败 1:匹配中 2:待支付 3:已支付 4:对方已确认 5:已完成 |
| | | |
| | | private String wxQrcode;//微信收款码 |
| | | private String aliQrcode;//支付宝收款码 |
| | | private String bankName;//真实姓名 |
| | | private String bankNo;//银行卡号 |
| | | private String bank;//开户行 |
| | | private String phone;//手机号 |
| | | private String usdtTongdao;//USDT通道类型: TRC20 BEP20 |
| | | private String usdtAddress;//USDT地址 |
| | | } |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cc.mrbird.febs.mall.mapper.MallProductNftMapper"> |
| | | <mapper namespace="cc.mrbird.febs.mall.mapper.MallProductBuyMapper"> |
| | | |
| | | <select id="getProductNFTList" resultType="cc.mrbird.febs.mall.vo.AdminMallProductNftVo"> |
| | | SELECT |
| | | a.* |
| | | FROM mall_product_nft a |
| | | <select id="selectMemberIdAndNFTIdAndStateAndMateState" resultType="cc.mrbird.febs.mall.entity.MallProductBuy"> |
| | | select * from mall_product_buy |
| | | <where> |
| | | member_id = #{memberId} |
| | | and product_nft_id = #{productNFTId} |
| | | <if test="state != null"> |
| | | and state = #{state} |
| | | </if> |
| | | <if test="mateState != null"> |
| | | and mate_state = #{mateState} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectListInPage" resultType="cc.mrbird.febs.mall.vo.ApiOrderListVo"> |
| | | select a.id,a.order_no,a.CREATED_TIME,a.nft_total,a.state,2 as type |
| | | from mall_product_buy a |
| | | where a.state = 1 |
| | | and a.member_id = #{record.memberId} |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | <select id="selectByState" resultType="cc.mrbird.febs.mall.vo.ApiMallProductNftVo"> |
| | | SELECT |
| | | a.* |
| | | FROM mall_product_nft a |
| | | where a.state = #{state} |
| | | </select> |
| | | |
| | | <select id="getBuyList" resultType="cc.mrbird.febs.mall.vo.AdminMallProductBuyVo"> |
| | | SELECT |
| | | a.*, |
| | | b.account_login |
| | | FROM mall_product_buy a |
| | | left join mall_member b on a.member_id = b.id |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | <select id="getSellList" resultType="cc.mrbird.febs.mall.vo.AdminMallProductSellVo"> |
| | | SELECT |
| | | a.*, |
| | | b.account_login |
| | | FROM mall_product_sell a |
| | | left join mall_member b on a.member_id = b.id |
| | | order by a.CREATED_TIME desc |
| | | <select id="selectBuyById" resultType="cc.mrbird.febs.mall.vo.ApiOrderBuyInfoVo"> |
| | | select a.* |
| | | from mall_product_buy a |
| | | where a.id = #{id} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cc.mrbird.febs.mall.mapper.MallProductBuyRecordMapper"> |
| | | |
| | | <select id="selectByBuyId" resultType="cc.mrbird.febs.mall.vo.ApiOrderBuyRecordInfoVo"> |
| | | select a.*, |
| | | b.account_login, |
| | | c.wx_qrcode, |
| | | c.ali_qrcode, |
| | | c.bank_name, |
| | | c.phone, |
| | | c.bank, |
| | | c.bank_no, |
| | | c.usdt_tongdao, |
| | | c.usdt_address |
| | | from mall_product_buy_record a |
| | | left join mall_member b on a.member_id = b.id |
| | | left join mall_member_payment c on a.member_id = c.member_id |
| | | where a.buy_id = #{productBuyId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cc.mrbird.febs.mall.mapper.MallProductBuyMapper"> |
| | | <mapper namespace="cc.mrbird.febs.mall.mapper.MallProductNftMapper"> |
| | | |
| | | <select id="selectMemberIdAndNFTIdAndStateAndMateState" resultType="cc.mrbird.febs.mall.entity.MallProductBuy"> |
| | | select * from mall_product_buy |
| | | <select id="getProductNFTList" resultType="cc.mrbird.febs.mall.vo.AdminMallProductNftVo"> |
| | | SELECT |
| | | a.* |
| | | FROM mall_product_nft a |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | <select id="selectByState" resultType="cc.mrbird.febs.mall.vo.ApiMallProductNftVo"> |
| | | SELECT |
| | | a.* |
| | | FROM mall_product_nft a |
| | | where a.state = #{state} |
| | | </select> |
| | | |
| | | <select id="getBuyList" resultType="cc.mrbird.febs.mall.vo.AdminMallProductBuyVo"> |
| | | SELECT |
| | | a.*, |
| | | b.account_login |
| | | FROM mall_product_buy a |
| | | left join mall_member b on a.member_id = b.id |
| | | <where> |
| | | member_id = #{memberId} |
| | | and product_nft_id = #{productNFTId} |
| | | <if test="state != null"> |
| | | and state = #{state} |
| | | </if> |
| | | <if test="mateState != null"> |
| | | and mate_state = #{mateState} |
| | | <if test="record != null" > |
| | | <if test="record.accountLogin!=null and record.accountLogin!=''"> |
| | | and b.account_login like concat('%', #{record.accountLogin},'%') |
| | | </if> |
| | | </if> |
| | | </where> |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | <select id="getSellList" resultType="cc.mrbird.febs.mall.vo.AdminMallProductSellVo"> |
| | | SELECT |
| | | a.*, |
| | | b.account_login |
| | | FROM mall_product_sell a |
| | | left join mall_member b on a.member_id = b.id |
| | | <where> |
| | | <if test="record != null" > |
| | | <if test="record.accountLogin!=null and record.accountLogin!=''"> |
| | | and b.account_login like concat('%', #{record.accountLogin},'%') |
| | | </if> |
| | | </if> |
| | | </where> |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | <select id="selectProductSellByState" resultType="cc.mrbird.febs.mall.vo.AdminMallProductSellPickVo"> |
| | | SELECT |
| | | a.id id, |
| | | CONCAT(b.account_login,'-总数:',a.nft_cnt,'-剩余:',a.nft_cnt_ava) name |
| | | FROM mall_product_sell a |
| | | left join mall_member b on a.member_id = b.id |
| | | where a.state = #{state} |
| | | and a.nft_cnt_ava > 0 |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cc.mrbird.febs.mall.mapper.MallProductSellMapper"> |
| | | |
| | | <select id="selectListInPage" resultType="cc.mrbird.febs.mall.vo.ApiOrderListVo"> |
| | | select a.id,a.order_no,a.CREATED_TIME,a.nft_total,a.state,1 as type |
| | | from mall_product_sell a |
| | | where a.state = 1 |
| | | and a.member_id = #{record.memberId} |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | <select id="selectSellInfoById" resultType="cc.mrbird.febs.mall.vo.ApiOrderSellInfoVo"> |
| | | select a.* |
| | | from mall_product_sell a |
| | | where a.id = #{id} |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cc.mrbird.febs.mall.mapper.MallProductSellRecordMapper"> |
| | | |
| | | <select id="selectBySellId" resultType="cc.mrbird.febs.mall.vo.ApiOrderSellRecordInfoVo"> |
| | | select a.*, |
| | | b.account_login, |
| | | c.wx_qrcode, |
| | | c.ali_qrcode, |
| | | c.bank_name, |
| | | c.phone, |
| | | c.bank, |
| | | c.bank_no, |
| | | c.usdt_tongdao, |
| | | c.usdt_address |
| | | from mall_product_sell_record a |
| | | left join mall_member b on a.member_id = b.id |
| | | left join mall_member_payment c on a.member_id = c.member_id |
| | | where a.sell_id = #{productSellId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <div class="layui-card-body febs-table-full"> |
| | | <form class="layui-form layui-table-form" lay-filter="user-table-form"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="add"> |
| | | 新增 |
| | | |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">登录账户:</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" placeholder="登录账户" name="accountLogin" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | | <!-- <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="add">--> |
| | | <!-- 新增--> |
| | | <!-- </div>--> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | |
| | | table.on('tool(buyTable)', function (obj) { |
| | | var data = obj.data, |
| | | layEvent = obj.event; |
| | | if (layEvent === 'productNFTUpdate') { |
| | | febs.modal.open('编辑', 'modules/news/productNFTUpdate/' + data.id, { |
| | | if (layEvent === 'productSellPick') { |
| | | febs.modal.open('编辑', 'modules/news/productSellPick/' + data.id, { |
| | | btn: ['提交', '取消'], |
| | | yes: function (index, layero) { |
| | | $('#nftInfo-update').find('#submit').trigger('click'); |
| | | $('#product-sell-pick').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | |
| | | cols: [[ |
| | | {field: 'accountLogin', title: '登录账户', minWidth: 120,align:'center'}, |
| | | {field: 'nftTotal', title: '预约额度', minWidth: 120,align:'center'}, |
| | | {field: 'nftAva', title: '已分配', minWidth: 120,align:'center'}, |
| | | {field: 'nftAva', title: '可分配', minWidth: 120,align:'center'}, |
| | | {field: 'orderTime', title: '匹配时间', minWidth: 120,align:'center'}, |
| | | {templet: '#isBuyState', title: '预约状态', minWidth: 120,align:'center'}, |
| | | {templet: '#isBuyMateState', title: '匹配状态', minWidth: 120,align:'center'}, |
| | | {title: '操作', |
| | | templet: function (d) { |
| | | if(d.state == 1){ |
| | | return '' |
| | | if(d.mateState == 1){ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="productSellPick" shiro:hasPermission="user:update">手动匹配</button>' |
| | | }else{ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="productNFTUpdate" shiro:hasPermission="user:update">编辑</button>' |
| | | +'<button class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delNFT" shiro:hasPermission="user:update">删除</button>' |
| | | return '' |
| | | } |
| | | },minWidth: 300,align:'center'} |
| | | ]] |
| | |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return { |
| | | accountLogin: $searchForm.find('input[name="accountLogin"]').val().trim(), |
| | | }; |
| | | } |
| | | |
| | |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-product-sell" lay-title="NFT提现记录"> |
| | | <div class="layui-fluid layui-anim febs-anim" id="febs-product-sell" lay-title="用户NFT提现"> |
| | | <div class="layui-row febs-container"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body febs-table-full"> |
| | | <form class="layui-form layui-table-form" lay-filter="user-table-form"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="add"> |
| | | 新增 |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">登录账户:</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" placeholder="登录账户" name="accountLogin" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | | <!-- <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="add">--> |
| | | <!-- 新增--> |
| | | <!-- </div>--> |
| | | <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query"> |
| | | <i class="layui-icon"></i> |
| | | </div> |
| | |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return { |
| | | accountLogin: $searchForm.find('input[name="accountLogin"]').val().trim(), |
| | | }; |
| | | } |
| | | }) |
New file |
| | |
| | | <style> |
| | | #product-sell-pick { |
| | | padding: 20px 25px 25px 0; |
| | | } |
| | | |
| | | #product-sell-pick .layui-treeSelect .ztree li a, .ztree li span { |
| | | margin: 0 0 2px 3px !important; |
| | | } |
| | | #product-sell-pick #data-permission-tree-block { |
| | | border: 1px solid #eee; |
| | | border-radius: 2px; |
| | | padding: 3px 0; |
| | | } |
| | | #product-sell-pick .layui-treeSelect .ztree li span.button.switch { |
| | | top: 1px; |
| | | left: 3px; |
| | | } |
| | | #product-sell-pick img{ |
| | | max-width:100px |
| | | } |
| | | |
| | | </style> |
| | | <div class="layui-fluid" id="product-sell-pick"> |
| | | <form class="layui-form" action="" lay-filter="product-sell-pick-form"> |
| | | <div class="layui-form-item febs-hide"> |
| | | <label class="layui-form-label febs-form-item-require">id:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="id"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">预约额度:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="nftTotal" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">可分配:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="nftAva" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" readonly> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <blockquote class="layui-elem-quote blue-border">匹配设置</blockquote> |
| | | <div class="layui-row layui-col-space10 layui-form-item"> |
| | | <div class="layui-form-item sell-pick-list"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">匹配提现:</label> |
| | | <div class="layui-input-block"> |
| | | <div id="sell-pick-list"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">本次金额:</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" name="pickNftCnt" lay-verify="required" placeholder="" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item febs-hide"> |
| | | <button class="layui-btn" lay-submit="" lay-filter="product-sell-pick-form-submit" id="submit"></button> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | |
| | | <script data-th-inline="javascript"> |
| | | layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree','layedit', 'laydate', 'upload', 'xmSelect'], function () { |
| | | var $ = layui.$, |
| | | febs = layui.febs, |
| | | layer = layui.layer, |
| | | upload = layui.upload, |
| | | formSelects = layui.formSelects, |
| | | form = layui.form, |
| | | laydate = layui.laydate, |
| | | layedit = layui.layedit, |
| | | mallProductBuy = [[${mallProductBuy}]], |
| | | $view = $('#product-sell-pick'), |
| | | validate = layui.validate; |
| | | |
| | | var sellPick = xmSelect.render({ |
| | | el: '#sell-pick-list', |
| | | filterable: true,//设置搜索框 |
| | | filterMethod: function(val, item, index, prop){ |
| | | if(val == item.value){//把value相同的搜索出来 |
| | | return true; |
| | | } |
| | | if(item.name.indexOf(val) != -1){//名称中包含的搜索出来 |
| | | return true; |
| | | } |
| | | return false;//不知道的就不管了 |
| | | }, |
| | | language: 'zn', |
| | | prop : { |
| | | value : 'id', |
| | | children : 'child' |
| | | }, |
| | | iconfont: { |
| | | parent: 'hidden', |
| | | }, |
| | | radio: true,//单选 |
| | | clickClose: true, |
| | | tree: { |
| | | show: true, |
| | | //非严格模式 |
| | | strict: false, |
| | | }, |
| | | data: [] |
| | | }) |
| | | |
| | | febs.get(ctx + 'admin/news/findSellList', null, function(res) { |
| | | sellPick.update({ |
| | | data : res.data, |
| | | autoRow: true, |
| | | }); |
| | | }) |
| | | initPickValue(); |
| | | form.render(); |
| | | laydate.render({ |
| | | elem: '#febs-form-group-date' |
| | | }); |
| | | |
| | | formSelects.render(); |
| | | form.on('submit(product-sell-pick-form-submit)', function (data) { |
| | | let sellPickList = sellPick.getValue(); |
| | | if (sellPickList.length > 0) { |
| | | var sellPickId = null; |
| | | layui.each(sellPickList, function (key, item) { |
| | | sellPickId = item.id |
| | | }); |
| | | data.field.productSellId = sellPickId; |
| | | } |
| | | febs.post(ctx + 'admin/news/pickSellRecord', data.field, function () { |
| | | layer.closeAll(); |
| | | febs.alert.success('操作成功'); |
| | | $('#febs-product-buy').find('#reset').click(); |
| | | }); |
| | | return false; |
| | | }); |
| | | |
| | | |
| | | function initPickValue() { |
| | | form.val("product-sell-pick-form", { |
| | | "id": mallProductBuy.id, |
| | | "nftTotal": mallProductBuy.nftTotal, |
| | | "nftAva": mallProductBuy.nftAva, |
| | | }); |
| | | } |
| | | }); |
| | | </script> |