general_create_trans_flowchart_v2
2016-03-10 10:06:47 0 举报
`general_create_trans_flowchart_v2` 是一个用于创建通用事务流程图的函数。它接收一系列事务步骤作为输入,并生成一个可视化的流程图,以帮助用户更好地理解和分析事务的处理过程。该函数支持多种输出格式,如PNG、SVG和PDF等,以满足不同用户的需求。此外,它还提供了丰富的自定义选项,如调整颜色、字体大小和样式等,以便用户根据自己的喜好进行个性化设置。总之,`general_create_trans_flowchart_v2` 是一个功能强大且易于使用的事务流程图生成工具,适用于各种场景,如软件开发、项目管理和企业流程优化等。
作者其他创作
大纲/内容
N
从in_pack读入其它MISC信息,放入infoext_time、deadline_time放入info.extrasource_ip、user_mac、comments
Y
if ((has_share_profit_solution || is_entrust_billing_solution)&& (info.SETTLEMENT_TYPE_REALTIME != info.settlement_type))前只有实时结算才支持分润或者分账
从in_pack读取create_mode,放入cm
从in_pack读入价格、优惠信息,放入infounit_price_amountunit_counttransport_amountadjust_price_amountadjust_transport_amountcash_amountcash_amount_newcoupon_amountcoupon_startegycoupon_strategy_id
fee_account != info.seller收益账户不与卖家相同
fee_account收益账户必须是C账户
buyer是customer或者merchantuser_id分布规则
info.channel_id = trans_settlement_info::CHANNEL_ID_DEFAULT(1)
check_up_merchant_info
从in_pack读入上层商户信息,放入infoup_merchant_info设置has_up_merchant
目前只有中介和直付交易才支持多进并行支付类型if ((info.PARALLEL_TYPE_MULTIPLE_IN_MASK & info.parallel_type)&& (info.PAYMENT_MODE_MEDIATE != payment_mode)&& (info.PAYMENT_MODE_DIRECT != payment_mode))
buyer_fee_account收益账户必须是C账户
从in_pack读取交易属性,放入infotrans_id_exttrans_typetrans_tagcan_modifytrans_mode从模板获取payment_mode,放入info
in_pack中是否传入trans_id
!in_redis如redis中没有
手续费不能大于交易总现金金额if (info.fee_amount info.get_total_cash_amount())((cash_amount + pay_solution_amount + mkt_solution_amount - _mkt_total_no_settlement_amount))
数据库有的话用数据库的,否则调用billNo新生成一个trans_id_in_redis = is_used ? info.trans_id : trans_id_client_.info_bill_no(
if (cm == create_trans_by_allocated_trans_id)如果利用预生成交易单创建交易单
从in_pack读入info.buyer_fee_account.user_idinfo.buyer_fee_account.sub_account_type = SUB_ACCOUNT_TYPE_DEFAULT(1)info.buyer_fee_account.currency = info.buyer.currency
fee_account必须存在(查DB)
info.share_profit_type = info.SHARE_PROFIT_TYPE_REALTIME如果有分润方案默认使用实时分润
如果是预下单if (cm == pre_mode_to_create_trans) {
从in_pack读入结算信息,放入infochannel_idfee_amountsettlement_typebuyer_fee_amount设置has_read_channel_id
即在redis里又在库里,且判断trans_id是否一致if (is_used && in_redis && trans_id_in_redis != info.trans_id)
从In_pack读取分润与分账信息,放入infoshare_profit_typeshare_billing_type设置has_share_profit_type、is_entrust_billing_solution
if (0 != info.coupon_amount)目前不支持coupon_amount,所以coupon_amount一定要为0
has_read_channel_id?
has_pay_trans_solution如果传入有付款方案
info.seller.sub_account_type = SUB_ACCOUNT_TYPE_DEFAULT(1)卖家使用已结算账户
从In_pack读取付款以及分润方案信息,放入solution_infopay_trans_solutionshare_profit_solution设置has_pay_trans_solution、has_share_profit_solution
去DB中查询是info.trans_id_ext去否存在如存在,将trans_id放入info.trans_id设置is_used
检查state是否不为createjudge_repeat_pay(trans)
从in_pack读入卖家信息,放入info.sellersp_iduser_idlogin_nametrue_name设置seller.currency=buyer.currency
从in_pack读入端信息,放入infoclient_source_flag_create并设置has_client_source_flag_create
是否传入平台商户if (!has_up_merchant)
从in_pack读取买家属性,放入info.buyeruser_idlogin_nametrue_namecurrency赋默认值info.buyer.sub_account_type = SUB_ACCOUNT_TYPE_DEFAULT
委托分账必须实时分润is_entrust_billing_solution && info.share_profit_type != SHARE_PROFIT_TYPE_REALTIME
获取redis重入keyredis_key = cmd_trans_id_ext_logid;
if (0 != info.fee_amount)只有fee_amount不为0时才需要fee_user_id
TRANS_CANNOT_MODIFY
如果是新订单且为委托分账if (is_entrust_billing_solution && !is_used)
依据info.trans_id_ext从redis中查询trans_id,放入trans_id_in_redis,并设置in_redis
buyer_fee_account != info.seller收益账户不与卖家相同
buyer_fee_account必须存在(查DB)
has_share_profit_solution
switch (info.can_modify)要么传入,要么默认cannot
TRANS_CAN_MODIFY_GATEWAY_INFO
从in_pack读入商品信息,放入infogoods_namegoods_urlgoods_typegoods_channelgoods_channel_sp_id
校验金额info.validate()total_good_amount = unit_price_amount * unit_count + transport_amount + adjust_price_amount + adjust_transport_amount;total_payment_amount = cash_amount + coupon_amount + pay_solution_amount + mkt_solution_amount + coupon_amount_new;total_good_amount必须等于total_payment_amount
service_exception
if (0 info.coupon_strategy_id)
seller是customer或者merchantuser_id分布规则
计算并行支付类型,放入info.parallel_type1)如传入有付款方案,10102)如传入有分润或分账方案,01013)啥都没有,0000
TRANS_CAN_MODIFY_ALL
卖家买家user_id不同
buyer_fee_account != info.buer收益账户不与买家相同
从in_pack读入info.fee_account.user_idinfo.fee_account.sub_account_type = SUB_ACCOUNT_TYPE_DEFAULT(1)info.fee_account.currency = info.buyer.currency
info.settlement_type!=realtime为异步结算
检查平台商户传入是否正确
给trans_id赋值如果redis里面有,直接用如果redis里没有库里有。用库里的如果redis和库里都没有,生成info.trans_id = trans_id_in_redis;
分润总金额不能大于分润前支付给卖家的金额if (solution_info.share_profit_solution().get_total_amount() (info.get_total_cash_amount() - info.fee_amount))
buyer_fee_amount != 0
DEFAULT
初始化一些值bool is_modified = false;info.state = info.TRANS_STATE_CREATED;info.share_profit_flag = info.SHARE_PROFIT_FLAG_UNDO;
if (has_share_profit_solution && is_entrust_billing_solution)|| has_share_profit_solution && info.share_billing_type != trans_info::SHARE_TRANS_TYPE_NORMAL如果传入有分润方案,则不能为委托分账或分普通类型分账
如果传入付款方案分润方案,则赋值给本地变量,if (has_pay_trans_solution/has_share_profit_solution) {trans_solution.pay_trans_solution/share_profit_solution = solution_info.pay_trans_solution/share_profit_solution;
info.seller.sub_account_type = SUB_ACCOUNT_TYPE_UNSETTLED(3)卖家使用待结算账户
0 条评论
下一页
为你推荐
查看更多