class AlipayDivisionRecordChannelNotifyService extends AbstractDivisionRecordChannelNotifyService {

    @Override
    public String getIfCode() {
        return CS.IF_CODE.ALIPAY;
    }

    @Override
    public MutablePair<String, Object> parseParams(HttpServletRequest request) {

        try {
            JSONObject params = getReqParamJSON();

            String batchOrderId = params.getJSONObject("biz_content").getString("out_request_no"); // 分账批次号
            return MutablePair.of(batchOrderId, params);

        } catch (Exception e) {

            log.error("error", e);
            throw ResponseException.buildText("ERROR");

        }
    }

    @Override
    public DivisionChannelNotifyModel doNotify(HttpServletRequest request, Object params, List<PayOrderDivisionRecord> recordList, MchAppConfigContext mchAppConfigContext) {<FILL_FUNCTION_BODY>}


}


        // 响应结果
        DivisionChannelNotifyModel result = new DivisionChannelNotifyModel();

        try {

            //配置参数获取
            Byte useCert = null;
            String alipaySignType, alipayPublicCert, alipayPublicKey = null;
            if(mchAppConfigContext.isIsvsubMch()){

                // 获取支付参数
                AlipayIsvParams alipayParams = (AlipayIsvParams)configContextQueryService.queryIsvParams(mchAppConfigContext.getMchInfo().getIsvNo(), getIfCode());
                useCert = alipayParams.getUseCert();
                alipaySignType = alipayParams.getSignType();
                alipayPublicCert = alipayParams.getAlipayPublicCert();
                alipayPublicKey = alipayParams.getAlipayPublicKey();

            }else{

                // 获取支付参数
                AlipayNormalMchParams alipayParams = (AlipayNormalMchParams)configContextQueryService.queryNormalMchParams(mchAppConfigContext.getMchNo(), mchAppConfigContext.getAppId(), getIfCode());

                useCert = alipayParams.getUseCert();
                alipaySignType = alipayParams.getSignType();
                alipayPublicCert = alipayParams.getAlipayPublicCert();
                alipayPublicKey = alipayParams.getAlipayPublicKey();
            }

            // 获取请求参数
            JSONObject jsonParams = (JSONObject) params;

            boolean verifyResult;
            if(useCert != null && useCert == CS.YES){  //证书方式

                verifyResult = AlipaySignature.rsaCertCheckV1(jsonParams.toJavaObject(Map.class), getCertFilePath(alipayPublicCert),
                        AlipayConfig.CHARSET, alipaySignType);

            }else{
                verifyResult = AlipaySignature.rsaCheckV1(jsonParams.toJavaObject(Map.class), alipayPublicKey, AlipayConfig.CHARSET, alipaySignType);
            }

            //验签失败
            if(!verifyResult){
                throw ResponseException.buildText("ERROR");
            }

            // 得到所有的 accNo 与 recordId map
            Map<String, Long> accnoAndRecordIdSet = new HashMap<>();
            for (PayOrderDivisionRecord record : recordList) {
                accnoAndRecordIdSet.put(record.getAccNo(), record.getRecordId());
            }

            Map<Long, ChannelRetMsg> recordResultMap = new HashMap<>();

            JSONObject bizContentJSON = jsonParams.getJSONObject("biz_content");

            // 循环
            JSONArray array = bizContentJSON.getJSONArray("royalty_detail_list");
            for (Object o : array) {
                JSONObject itemJSON = (JSONObject) o;

                // 我方系统的分账接收记录ID
                Long recordId = accnoAndRecordIdSet.get(itemJSON.getString("trans_in"));

                // 分账类型 && 包含该笔分账账号
                if("transfer".equals(itemJSON.getString("operation_type")) && recordId != null){

                    // 分账成功
                    if("SUCCESS".equals(itemJSON.getString("state"))){
                        recordResultMap.put(recordId, ChannelRetMsg.confirmSuccess(bizContentJSON.getString("settle_no")));
                    }

                    // 分账失败
                    if("FAIL".equals(itemJSON.getString("state"))){
                        recordResultMap.put(recordId, ChannelRetMsg.confirmFail(bizContentJSON.getString("settle_no"), itemJSON.getString("error_code"), itemJSON.getString("error_desc")));
                    }
                }
            }

            result.setRecordResultMap(recordResultMap);
            result.setApiRes(textResp("success"));

            return result;

        } catch (Exception e) {

            log.error("error", e);
            throw ResponseException.buildText("ERROR");

        }
    
<methods>public non-sealed void <init>() ,public abstract com.jeequan.jeepay.pay.rqrs.msg.DivisionChannelNotifyModel doNotify(HttpServletRequest, java.lang.Object, List<com.jeequan.jeepay.core.entity.PayOrderDivisionRecord>, com.jeequan.jeepay.pay.model.MchAppConfigContext) ,public ResponseEntity doNotifyOrderNotExists(HttpServletRequest) ,public ResponseEntity doNotifyOrderStateUpdateFail(HttpServletRequest) ,public abstract java.lang.String getIfCode() ,public abstract MutablePair<java.lang.String,java.lang.Object> parseParams(HttpServletRequest) <variables>private com.jeequan.jeepay.pay.util.ChannelCertConfigKitBean channelCertConfigKitBean,protected com.jeequan.jeepay.pay.service.ConfigContextQueryService configContextQueryService,private com.jeequan.jeepay.core.beans.RequestKitBean requestKitBean