|
|
|
@@ -45,39 +45,6 @@ public class WxBillController extends BaseController { |
|
|
|
@PostMapping("listBillOweAndWaitPay") |
|
|
|
public ResultData listBillOweAndWaitPay(@RequestBody WxBillAll wxBillAll) { |
|
|
|
|
|
|
|
|
|
|
|
// WxMerchantBUser wxMerchantBUser = new WxMerchantBUser(); |
|
|
|
// wxMerchantBUser.setAppId(wxBillAll.getAppId()); |
|
|
|
// wxMerchantBUser.setStatus(EnumMerchantBUserStatus.VALID.getCode()); |
|
|
|
// try { |
|
|
|
// wxMerchantBUser = wxMerchantBUserService.getBUserByAppId(wxMerchantBUser); |
|
|
|
// } catch (Exception e) { |
|
|
|
// logger.error(e.getMessage()); |
|
|
|
// logger.error("B端用户不存在"); |
|
|
|
// return new ResultData(ErrorCode.USER_IS_EMPTY); |
|
|
|
// } |
|
|
|
// WxMerchant merchant = null; |
|
|
|
// if (wxMerchantBUser != null) { |
|
|
|
// // check merchant 状态 |
|
|
|
// try { |
|
|
|
// merchant = wxMerchantService.getById(wxMerchantBUser.getMerchantId()); |
|
|
|
// } catch (Exception e) { |
|
|
|
// logger.error(ErrorCode.DB_FAIL.getMessage() + ": " + wxMerchantBUser.getMerchantId() + e.getMessage()); |
|
|
|
// return new ResultData(ErrorCode.DB_FAIL); |
|
|
|
// } |
|
|
|
// if (merchant == null) { |
|
|
|
// logger.error(ErrorCode.MERCHANT_INFO_NOT_FOUND.getMessage() + ": " + wxMerchantBUser.getMerchantId()); |
|
|
|
// return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); |
|
|
|
// } |
|
|
|
// if (merchant.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode())) { |
|
|
|
// logger.error(ErrorCode.MERCHANT_INFO_NOT_VALID.getMessage() + ": " + wxMerchantBUser.getMerchantId()); |
|
|
|
// return new ResultData(ErrorCode.MERCHANT_INFO_NOT_VALID); |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// logger.error("B端用户不存在"); |
|
|
|
// return new ResultData(ErrorCode.USER_IS_EMPTY); |
|
|
|
// } |
|
|
|
|
|
|
|
if(StringUtils.isEmpty(wxBillAll.getTenantId())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"tenantId不能为空"); |
|
|
|
} |
|
|
|
@@ -98,38 +65,6 @@ public class WxBillController extends BaseController { |
|
|
|
@ApiOperation("账单") |
|
|
|
@PostMapping("listBill") |
|
|
|
public ResultData listBill(@RequestBody WxBillAll wxBillAll) { |
|
|
|
// WxMerchantBUser wxMerchantBUser = new WxMerchantBUser(); |
|
|
|
// wxMerchantBUser.setAppId(wxBillAll.getAppId()); |
|
|
|
// wxMerchantBUser.setStatus(EnumMerchantBUserStatus.VALID.getCode()); |
|
|
|
// try { |
|
|
|
// wxMerchantBUser = wxMerchantBUserService.getBUserByAppId(wxMerchantBUser); |
|
|
|
// } catch (Exception e) { |
|
|
|
// logger.error(e.getMessage()); |
|
|
|
// logger.error("B端用户不存在"); |
|
|
|
// return new ResultData(ErrorCode.USER_IS_EMPTY); |
|
|
|
// } |
|
|
|
// |
|
|
|
// WxMerchant merchant = null; |
|
|
|
// if (wxMerchantBUser != null) { |
|
|
|
// // check merchant 状态 |
|
|
|
// try { |
|
|
|
// merchant = wxMerchantService.getById(wxMerchantBUser.getMerchantId()); |
|
|
|
// } catch (Exception e) { |
|
|
|
// logger.error(ErrorCode.DB_FAIL.getMessage() + ": " + wxMerchantBUser.getMerchantId() + e.getMessage()); |
|
|
|
// return new ResultData(ErrorCode.DB_FAIL); |
|
|
|
// } |
|
|
|
// if (merchant == null) { |
|
|
|
// logger.error(ErrorCode.MERCHANT_INFO_NOT_FOUND.getMessage() + ": " + wxMerchantBUser.getMerchantId()); |
|
|
|
// return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND); |
|
|
|
// } |
|
|
|
// if (merchant.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode())) { |
|
|
|
// logger.error(ErrorCode.MERCHANT_INFO_NOT_VALID.getMessage() + ": " + wxMerchantBUser.getMerchantId()); |
|
|
|
// return new ResultData(ErrorCode.MERCHANT_INFO_NOT_VALID); |
|
|
|
// } |
|
|
|
// } else { |
|
|
|
// logger.error("B端用户不存在"); |
|
|
|
// return new ResultData(ErrorCode.USER_IS_EMPTY); |
|
|
|
// } |
|
|
|
|
|
|
|
if(StringUtils.isEmpty(wxBillAll.getTenantId())){ |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"tenantId不能为空"); |
|
|
|
@@ -144,6 +79,10 @@ public class WxBillController extends BaseController { |
|
|
|
if(wxMerchant.getStatus().equals(EnumMerchantStatus.NOT_VALID.getCode())){ |
|
|
|
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_VALID); |
|
|
|
} |
|
|
|
if(StringUtils.isEmpty(wxBillAll.getStarttime()) || StringUtils.isEmpty(wxBillAll.getEndtime())){ |
|
|
|
logger.info("开始时间和结束时间要同时存在或不存在"); |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"starttime和endtime要同时存在或不存在"); |
|
|
|
} |
|
|
|
return wxBillAllService.listBill(wxBillAll); |
|
|
|
} |
|
|
|
|
|
|
|
|