general_create_trans_flowchart
2016-03-09 13:06:13 0 举报
`general_create_trans_flowchart` 是一个用于创建通用事务流程图的函数。它接收一系列步骤作为输入,并生成一个可视化的流程图,以帮助用户更好地理解和分析事务的处理过程。这个函数通常应用于软件开发、业务流程优化等领域,以提高团队协作效率和降低错误率。通过使用 `general_create_trans_flowchart`,用户可以快速地创建出清晰、易于理解的事务流程图,从而为项目的成功实施奠定坚实基础。
作者其他创作
大纲/内容
N
if (cm == create_trans_by_allocated_trans_id)如果利用预生成交易单创建交易单
in_pack中是否传入trans_id
从in_pack读取买家属性,放入info.buyeruser_idlogin_nametrue_namecurrency赋默认值info.buyer.sub_account_type = SUB_ACCOUNT_TYPE_DEFAULT
is_reentry是否为重入
fee_account != info.seller收益账户不与卖家相同
compare_non_modifiable_trans_info比较缓存中的与传入的交易信息
目前只有中介和直付交易才支持多进并行支付类型if ((info.PARALLEL_TYPE_MULTIPLE_IN_MASK & info.parallel_type)&& (info.PAYMENT_MODE_MEDIATE != payment_mode)&& (info.PAYMENT_MODE_DIRECT != payment_mode))
compare_restricted_modifiable_trans_info比较缓存中的与传入的交易信息
Y
从In_pack读取分润与分账信息,放入infoshare_profit_typeshare_billing_type设置has_share_profit_type、is_entrust_billing_solution
judge_repeat_pay判断state是否为create
buyer_fee_amount != 0
校验以下信息必须一致trans_typepayment_modesellersp_idshare_profit_flag必须为未分润
TRANS_CANNOT_MODIFY
seller是customer或者merchantuser_id分布规则
是否传入平台商户if (!has_up_merchant)
校验金额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
!in_redis如redis中没有
info.seller.sub_account_type = SUB_ACCOUNT_TYPE_DEFAULT(1)卖家使用已结算账户
buyer_fee_account != info.seller收益账户不与卖家相同
info.seller.sub_account_type = SUB_ACCOUNT_TYPE_UNSETTLED(3)卖家使用待结算账户
if (0 != info.fee_amount)只有fee_amount不为0时才需要fee_user_id
fee_account收益账户必须是C账户
if (0 info.coupon_strategy_id)
从in_pack读入端信息,放入infoclient_source_flag_create并设置has_client_source_flag_create
如果multiple_in则pay_trans_solution要一致如果multiple_out则share_profic_solution要一致
检查state是否不为createjudge_repeat_pay(trans)
从in_pack读入价格、优惠信息,放入infounit_price_amountunit_counttransport_amountadjust_price_amountadjust_transport_amountcash_amountcash_amount_newcoupon_amountcoupon_startegycoupon_strategy_id
TRANS_CAN_MODIFY_GATEWAY_INFO
TRANS_CAN_MODIFY_ALL
DEFAULT
same_price
手续费不能大于交易总现金金额if (info.fee_amount info.get_total_cash_amount())((cash_amount + pay_solution_amount + mkt_solution_amount - _mkt_total_no_settlement_amount))
从in_pack读入结算信息,放入infochannel_idfee_amountsettlement_typebuyer_fee_amount设置has_read_channel_id
parallel_type最右2位必须一致
本地变量trans_create_info info;trans_create_info merchant_trans;trans_solution_info solution_info;string coupon_error_info;up_merchant_info merchant_info;bool has_up_merchant;
各个金额含义
如果是新订单且为委托分账if (is_entrust_billing_solution && !is_used)
从in_pack读入上层商户信息,放入infoup_merchant_info设置has_up_merchant
从in_pack读入卖家信息,放入info.sellersp_iduser_idlogin_nametrue_name设置seller.currency=buyer.currency
buyer是customer或者merchantuser_id分布规则
info.settlement_type!=realtime为异步结算
数据库有的话用数据库的,否则调用billNo新生成一个trans_id_in_redis = is_used ? info.trans_id : trans_id_client_.info_bill_no(
is_full_match
handle_cannot_modify_scenario(is_reentry=false)
检查平台商户传入是否正确
计算并行支付类型,放入info.parallel_type1)如传入有付款方案,10102)如传入有分润或分账方案,01013)啥都没有,0000
info.channel_id = trans_settlement_info::CHANNEL_ID_DEFAULT(1)
将trans和写入out_pack如果不是委托分账则将trans_solution写入out_pack
从in_pack读入其它MISC信息,放入infoext_time、deadline_time放入info.extrasource_ip、user_mac、comments
从in_pack读取交易属性,放入infotrans_id_exttrans_typetrans_tagcan_modifytrans_mode从模板获取payment_mode,放入info
委托分账必须实时分润is_entrust_billing_solution && info.share_profit_type != SHARE_PROFIT_TYPE_REALTIME
卖家买家user_id不同
即在redis里又在库里,且判断trans_id是否一致if (is_used && in_redis && trans_id_in_redis != info.trans_id)
校验一下信息必须一致trans_modebuyer.login_name/user_id/sub_account_type/currency
if (has_share_profit_solution && is_entrust_billing_solution)|| has_share_profit_solution && info.share_billing_type != trans_info::SHARE_TRANS_TYPE_NORMAL如果传入有分润方案,则不能为委托分账或分普通类型分账
从in_pack读入商品信息,放入infogoods_namegoods_urlgoods_typegoods_channelgoods_channel_sp_id
buyer_fee_account必须存在(查DB)
如果是预下单if (cm == pre_mode_to_create_trans) {
switch (info.can_modify)要么传入,要么默认cannot
info.share_profit_type = info.SHARE_PROFIT_TYPE_REALTIME如果有分润方案默认使用实时分润
has_share_profit_solution
获取redis重入keyredis_key = cmd_trans_id_ext_logid;
校验以下信息必须一致商品信息:goods.goods_name/url/type结算信息:settlement.fee_amount/fee_account/channel_id/settlement_type买家信息:buyer_fee_amount/buyer_fee_account
给trans_id赋值如果redis里面有,直接用如果redis里没有库里有。用库里的如果redis和库里都没有,生成info.trans_id = trans_id_in_redis;
if ((has_share_profit_solution || is_entrust_billing_solution)&& (info.SETTLEMENT_TYPE_REALTIME != info.settlement_type))前只有实时结算才支持分润或者分账
如果是普通分账
check_up_merchant_info
赋值给pay_solution_amountinfo.pay_solution_amount = solution_info.pay_trans_solution().get_total_amount();
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
has_read_channel_id?
buyer_fee_account收益账户必须是C账户
从In_pack读取付款以及分润方案信息,放入solution_infopay_trans_solutionshare_profit_solution设置has_pay_trans_solution、has_share_profit_solution
依据info.trans_id_ext从redis中查询trans_id,放入trans_id_in_redis,并设置in_redis
if (0 != info.coupon_amount)目前不支持coupon_amount,所以coupon_amount一定要为0
service_exception
从in_pack读取create_mode,放入cm
永远都不允许改的交易单信息
fee_account必须存在(查DB)
in_redis如果缓存里面有
分润总金额不能大于分润前支付给卖家的金额if (solution_info.share_profit_solution().get_total_amount() (info.get_total_cash_amount() - info.fee_amount))
有can_modify为CAN_MODIFY_ALL可以改的信息
has_pay_trans_solution如果传入有付款方案
去DB中查询是info.trans_id_ext去否存在如存在,将trans_id放入info.trans_id设置is_used
如果传入付款方案分润方案,则赋值给本地变量,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;
从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
初始化一些值bool is_modified = false;info.state = info.TRANS_STATE_CREATED;info.share_profit_flag = info.SHARE_PROFIT_FLAG_UNDO;
0 条评论
下一页
为你推荐
查看更多