|
|
@@ -38,15 +38,7 @@ public class WxProfitSharingReceiverApplyController extends BaseController { |
|
|
if(receiverAdd == null){ |
|
|
if(receiverAdd == null){ |
|
|
receiverAdd = new WxProfitSharingReceiverApply(); |
|
|
receiverAdd = new WxProfitSharingReceiverApply(); |
|
|
} |
|
|
} |
|
|
if(receiverAdd.getMerchantId() == null){ |
|
|
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "商户ID不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
WxMerchant merchant = wxMerchantService.selectById(receiverAdd.getMerchantId()); |
|
|
|
|
|
if(merchant == null || EnumMerchantStatus.NOT_VALID.getCode().equals(merchant.getStatus())){ |
|
|
|
|
|
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_VALID.getCode(),"商户不存在或已停用"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
receiverAdd.updateTenantInfo(merchant); |
|
|
|
|
|
|
|
|
receiverAdd.updateTenantInfo(getTenantInfo()); |
|
|
receiverAdd.setPlat(EnumAppPlat.WX.getCode()); |
|
|
receiverAdd.setPlat(EnumAppPlat.WX.getCode()); |
|
|
// if(receiverAdd.getPlat() == null){ |
|
|
// if(receiverAdd.getPlat() == null){ |
|
|
// receiverAdd.setPlat(EnumAppPlat.WX.getCode()); |
|
|
// receiverAdd.setPlat(EnumAppPlat.WX.getCode()); |
|
|
@@ -56,11 +48,6 @@ public class WxProfitSharingReceiverApplyController extends BaseController { |
|
|
// return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "平台不合法"); |
|
|
// return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "平台不合法"); |
|
|
// } |
|
|
// } |
|
|
|
|
|
|
|
|
WxProfitSharingReceiver receiver = wxProfitSharingReceiverService.findReceiver(merchant, merchant.getId(), EnumAppPlat.WX, EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT_v2); |
|
|
|
|
|
if(receiver != null && MerchantImportStatus.improt_success.getCode().equals(receiver.getWxImportStatus())){ |
|
|
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "该商户已进件成功"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(receiverAdd.getId() != null){ |
|
|
if(receiverAdd.getId() != null){ |
|
|
WxProfitSharingReceiverApply receiverApply = wxProfitSharingReceiverApplyService.selectById(receiverAdd.getId()); |
|
|
WxProfitSharingReceiverApply receiverApply = wxProfitSharingReceiverApplyService.selectById(receiverAdd.getId()); |
|
|
if(receiverApply == null){ |
|
|
if(receiverApply == null){ |
|
|
@@ -70,6 +57,17 @@ public class WxProfitSharingReceiverApplyController extends BaseController { |
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "该商户进件流程中,无法修改"); |
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "该商户进件流程中,无法修改"); |
|
|
} |
|
|
} |
|
|
}else{ |
|
|
}else{ |
|
|
|
|
|
if(receiverAdd.getMerchantId() == null){ |
|
|
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "商户ID不能为空"); |
|
|
|
|
|
} |
|
|
|
|
|
WxMerchant merchant = wxMerchantService.selectById(receiverAdd.getMerchantId()); |
|
|
|
|
|
if(merchant == null || EnumMerchantStatus.NOT_VALID.getCode().equals(merchant.getStatus())){ |
|
|
|
|
|
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_VALID.getCode(),"商户不存在或已停用"); |
|
|
|
|
|
} |
|
|
|
|
|
WxProfitSharingReceiver receiver = wxProfitSharingReceiverService.findReceiver(merchant, merchant.getId(), EnumAppPlat.WX, EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT_v2); |
|
|
|
|
|
if(receiver != null && MerchantImportStatus.improt_success.getCode().equals(receiver.getWxImportStatus())){ |
|
|
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "该商户已进件成功"); |
|
|
|
|
|
} |
|
|
WxProfitSharingReceiverApply receiverApply = wxProfitSharingReceiverApplyService.selectByPlat(merchant,merchant.getId(),EnumAppPlat.WX); |
|
|
WxProfitSharingReceiverApply receiverApply = wxProfitSharingReceiverApplyService.selectByPlat(merchant,merchant.getId(),EnumAppPlat.WX); |
|
|
if(receiverApply != null){ |
|
|
if(receiverApply != null){ |
|
|
if(receiverApply.getApplymentState() != null && !EnumSharingReceiverApplymentState.getUpdList().contains(receiverApply.getApplymentState())){ |
|
|
if(receiverApply.getApplymentState() != null && !EnumSharingReceiverApplymentState.getUpdList().contains(receiverApply.getApplymentState())){ |
|
|
|