|
|
@@ -0,0 +1,101 @@ |
|
|
|
|
|
package com.iformall.controller.market; |
|
|
|
|
|
|
|
|
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
|
|
import com.iformall.common.Result; |
|
|
|
|
|
import com.iformall.common.ResultData; |
|
|
|
|
|
import com.iformall.controller.base.BaseController; |
|
|
|
|
|
import com.iformall.domain.po.*; |
|
|
|
|
|
import com.iformall.domain.po.base.TenantEntity; |
|
|
|
|
|
import com.iformall.enums.EnumCashOutStatus; |
|
|
|
|
|
import com.iformall.enums.EnumPayWay; |
|
|
|
|
|
import com.iformall.service.*; |
|
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.HashMap; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 提现。微信需要小程序开通“企业付款到零钱”功能。 |
|
|
|
|
|
* @author alascor |
|
|
|
|
|
* |
|
|
|
|
|
*/ |
|
|
|
|
|
@RestController |
|
|
|
|
|
@RequestMapping("/api/cashout") |
|
|
|
|
|
@Api(description = "提现相关接口") |
|
|
|
|
|
public class WxCashOutController extends BaseController { |
|
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private WxCashOutService wxCashOutService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
WxCUserService wxCUserService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
WxMerchantService wxMerchantService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
WxMallService wxMallService; |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("分页列表接口") |
|
|
|
|
|
@GetMapping("list") |
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
|
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), |
|
|
|
|
|
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) |
|
|
|
|
|
public ResultData list(@ModelAttribute WxCashOut wxCashOut, Integer pageNum, Integer pageSize) { |
|
|
|
|
|
if (null == wxCashOut) wxCashOut = new WxCashOut(); |
|
|
|
|
|
TenantEntity tenantInfo = getTenantInfo(); |
|
|
|
|
|
wxCashOut.updateTenantInfo(tenantInfo); |
|
|
|
|
|
if (null != wxCashOut.getStatus() && wxCashOut.getStatus().intValue()<0) { |
|
|
|
|
|
//提现中 |
|
|
|
|
|
List<Integer> statusList = new ArrayList<Integer>(); |
|
|
|
|
|
if (wxCashOut.getStatus().intValue()==99) { |
|
|
|
|
|
statusList.add(EnumCashOutStatus.AUDIOING.getCode()); |
|
|
|
|
|
statusList.add(EnumCashOutStatus.WAITING.getCode()); |
|
|
|
|
|
wxCashOut.setStatusList(statusList); |
|
|
|
|
|
wxCashOut.setStatus(null); |
|
|
|
|
|
//提现成功 |
|
|
|
|
|
}else if (wxCashOut.getStatus().intValue()==98) { |
|
|
|
|
|
statusList.add(EnumCashOutStatus.SUCCESS.getCode()); |
|
|
|
|
|
wxCashOut.setStatusList(statusList); |
|
|
|
|
|
wxCashOut.setStatus(null); |
|
|
|
|
|
//提现失败 |
|
|
|
|
|
}else if (wxCashOut.getStatus().intValue()==97) { |
|
|
|
|
|
statusList.add(EnumCashOutStatus.FAIL.getCode()); |
|
|
|
|
|
statusList.add(EnumCashOutStatus.BACK.getCode()); |
|
|
|
|
|
wxCashOut.setStatusList(statusList); |
|
|
|
|
|
wxCashOut.setStatus(null); |
|
|
|
|
|
//提现拒绝 |
|
|
|
|
|
}else if (wxCashOut.getStatus().intValue()==96) { |
|
|
|
|
|
statusList.add(EnumCashOutStatus.REJECT.getCode()); |
|
|
|
|
|
wxCashOut.setStatusList(statusList); |
|
|
|
|
|
wxCashOut.setStatus(null); |
|
|
|
|
|
//审批中 |
|
|
|
|
|
}else if (wxCashOut.getStatus().intValue()==96) { |
|
|
|
|
|
statusList.add(EnumCashOutStatus.AUDIOING.getCode()); |
|
|
|
|
|
wxCashOut.setStatusList(statusList); |
|
|
|
|
|
wxCashOut.setStatus(null); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
final PageInfo<WxCashOut> page = wxCashOutService.listAsPage(wxCashOut, pageNum, pageSize); |
|
|
|
|
|
return new ResultData(page); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("查询当前提现信息") |
|
|
|
|
|
@GetMapping("getInfo") |
|
|
|
|
|
@ApiImplicitParams({ |
|
|
|
|
|
@ApiImplicitParam(name = "id", value = "主键id", dataType = "Long", paramType = "query", required = true)}) |
|
|
|
|
|
public ResultData getCurrentCashOutData(Long id) { |
|
|
|
|
|
TenantEntity tenantInfo = getTenantInfo(); |
|
|
|
|
|
WxCashOut out = wxCashOutService.getById(id, tenantInfo.getTenantId()); |
|
|
|
|
|
return new ResultData(out); |
|
|
|
|
|
} |
|
|
|
|
|
} |