Atitit. atiOrder   Order 订单管理框架的设计

1. Order 订单处理流程1

2. code2

3. Ref7

1. Order 订单处理流程

if(userSvr.isNotLogin())

{

throw new RuntimeException(" not login 没登录,请先登录..#not_login");

}

User u=userSvr.getLoginUser();

Acc a=accSvr.getAcc(u.id);

BigDecimal needMoney=amoutCalcSvr.calc(order);

if(new ADecimal(needMoney ).biggerEqualThan(a.amount))

throw new RuntimeException("  amount not enough 金额不足够 ..#amount_not_enough ");

///...insert

storeSvr.insert(order);

orderlogSvr.log(order);

return accSvr.reduceAmount(u.id.toString(), needMoney.doubleValue());

作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 ) 汉字名:艾龙,  EMAIL:1466519819@qq.com

转载请注明来源: http://www.cnblogs.com/attilax/

2. code

package com.attilax.order;

import java.math.BigDecimal;

import java.util.Date;

import java.util.HashMap;

import java.util.List;

import java.util.Map;

import aaaCfg.IocX4casher;

import com.attilax.acc.Acc;

import com.attilax.acc.AccService;

import com.attilax.bet.AmountCalcService;

import com.attilax.db.DBX;

import com.attilax.io.filex;

import com.attilax.json.AtiJson;

import com.attilax.math.ADecimal;

import com.attilax.orm.AOrm;

import com.attilax.store.StoreService;

import com.attilax.user.User;

import com.attilax.user.UserService;

import com.google.inject.Inject;

public class OrderServiceV2 extends absService {

public static void main(String[] args) {

//final long time_intFmt = new Date().getTime() / 1000;

//System.out.println(time_intFmt);

//OrderServiceV2 os = IocX4casher.getBean(OrderServiceV2.class);

//os.insert(new HashMap() {

//{

//this.put("good_amount", 12.50);

//this.put("add_time", time_intFmt);

//this.put("confirm_time", time_intFmt);

//this.put("order_sn",filex.getUUidName());

//}

//});

//System.out.println("--f");

}

@Inject

StoreService storeSvr;

@Inject

UserService userSvr;

@Inject

AccService accSvr;

@Inject

AmountCalcService amoutCalcSvr;

@Inject

OrderLogService orderlogSvr;

public int insert(Map order) {

if(userSvr.isNotLogin())

{

throw new RuntimeException(" not login 没登录,请先登录..#not_login");

}

User u=userSvr.getLoginUser();

Acc a=accSvr.getAcc(u.id);

BigDecimal needMoney=amoutCalcSvr.calc(order);

if(new ADecimal(needMoney ).biggerEqualThan(a.amount))

throw new RuntimeException("  amount not enough 金额不足够 ..#amount_not_enough ");

///...insert

storeSvr.insert(order);

orderlogSvr.log(order);

return accSvr.reduceAmount(u.id.toString(), needMoney.doubleValue());

}

public List<Map> query(Map order) {

if(userSvr.isNotLogin())

{

throw new RuntimeException(" not login 没登录,请先登录..#not_login");

}

User u=userSvr.getLoginUser();

return null;

///...insert

//return accSvr.reduceAmount(u.id.toString(), needMoney.doubleValue());

}

public String query2json(Map order) {

return AtiJson.toJson(query(order));

///...insert

//return accSvr.reduceAmount(u.id.toString(), needMoney.doubleValue());

}

}

3. Ref

Atitit. 订单管理 收银单持久化 功能设计  基于ecshop订单结构

Atitit. atiOrder   Order 订单管理框架的设计的更多相关文章

  1. SAP CRM系统订单模型的设计与实现

    SAP成都研究院的一个部门领导让我给他的团队做一个SAP CRM One Order框架的培训,这是我准备的培训内容. 在Jerry之前的文章 基于SAP Kyma的订单编排增强介绍,我表达了自己对S ...

  2. Atitit.cateService分类管理新特性与设计文档说明v1

    Atitit.cateService分类管理新特性与设计文档说明v1 1. V2 新特性规划1 2. 分类管理1 3. 分类增加与修改维护2 4. Js控件分类数据绑定2 1. V2 新特性规划 增加 ...

  3. atitit.atiOrmStoreService 框架的原理与设计 part1  概述与新特性

    atitit.atiOrmStoreService 框架的原理与设计 part1  概述与新特性 1. 新特性如下 支持生成sql在无数据库连接的情况下 2. Orm设计 主要的俩个以来service ...

  4. Atitit. 数据库-----catalog与schema的设计区别以及在实际中使用 获取数据库所有库表 java jdbc php  c#.Net

    Atitit. 数据库-----catalog与schema的设计区别以及在实际中使用 获取数据库所有库表 java jdbc php  c#.Net 1. -catalog与schema的设计区别1 ...

  5. Atitit.加密算法ati Aes的框架设计

    Atitit.加密算法ati Aes的框架设计 版本进化 c:\1t\aesC47.java c:\1t\aes.java 增加了public static byte[] encrypt(byte[] ...

  6. Atitit.加密算法ati Aes的框架设计v2.2

    Atitit.加密算法ati Aes的框架设计v2.2 版本进化1 V2.2   add def decode key api1 v1版本1 Aes的历史2 Atitit.加密算法 des  aes  ...

  7. Atitit 修改密码的功能流程设计 attilax总结

    Atitit 修改密码的功能流程设计 attilax总结 1.1. 注意点1 1.2. 设计修改用户密码功能时把用户ID保存在哪里?1 1.3. Ui设计1 1.4. 功能设计源码1 1.5. Agt ...

  8. atitit. 日志系统的原则and设计and最佳实践(1)-----原理理论总结.

    atitit. 日志系统的原则and设计and最佳实践总结. 1. 日志系统是一种不可或缺的单元测试,跟踪调试工具 1 2. 日志系统框架通常应当包括如下基本特性 1 1. 所输出的日志拥有自己的分类 ...

  9. atitit.基于http json api 接口设计 最佳实践 总结o7

    atitit.基于http  json  api 接口设计 最佳实践 总结o7 1. 需求:::服务器and android 端接口通讯 2 2. 接口开发的要点 2 2.1. 普通参数 meth,p ...

随机推荐

  1. 13、Flask实战第13天:SQLAlchemy操作MySQL数据库

    安装MySQL 在MySQL官网下载win版MySQL 双击运行 后面根据提示设置密码然后启动即可,这里我设置的密码是:123456 我们可以通过Navicat客户端工具连接上MySQL addres ...

  2. luogu P1772 [ZJOI2006]物流运输

    题目描述 物流公司要把一批货物从码头A运到码头B.由于货物量比较大,需要n天才能运完.货物运输过程中一般要转停好几个码头.物流公司通常会设计一条固定的运输路线,以便对整个运输过程实施严格的管理和跟踪. ...

  3. 洛谷 - Sdchr 的邀请赛 T4 信息传递

    (乱搞艹爆正解系列) 对不起,由于博主太弱了,并不会正解的多项式exp(甚至多项式exp我都不会2333). 只能来说一说我是怎么乱搞的啦QWQ 首先这个题最关键的性质是: 一个在原置换 g 中长度为 ...

  4. 【树形DP】Codeforces Round #395 (Div. 2) C. Timofey and a tree

    标题写的树形DP是瞎扯的. 先把1看作根. 预处理出f[i]表示以i为根的子树是什么颜色,如果是杂色的话,就是0. 然后从根节点开始转移,转移到某个子节点时,如果其子节点都是纯色,并且它上面的那一坨结 ...

  5. 【动态规划】【最短路】【spfa】bzoj1207 [HNOI2004]打鼹鼠

    <法一>若打了一只鼹鼠后,还能打另一只,我们可以在它们之间连权值为1的边.于是答案就是 以m为终点的最长路长度+1.建反图,就是单源最长路. MLE TLE 一时爽. #include&l ...

  6. Xshell连接VM中Ubuntu

    摘要:终端输入ifconfig获取本地虚拟机的IP地址;安装openssh-serversudoapt-getinstallopenssh-server 查看server是否启动: ps-ef|gre ...

  7. 8.1(java学习笔记)注解(Annotation)

    一.Annotation Annotation不是程序本身,但它可以对程序进行解释,这一点和注释类似. 但最大的不同点在于,注解可以被其他程序读取,然后可以对其进行一些有针对性操作. 这是注解与注释最 ...

  8. 使用Python的turtle模块画出简单的柱状图

    代码如下: import turtle heights = [856, 420,360,260,205] def main(): t = turtle.Turtle() t.hideturtle() ...

  9. html5页面中 触发 拨打电话、发短信 的方式

    <a href="tel:18688888888">拨号</a> <a href="sms:18688888888">发短信 ...

  10. winform TreeView树节点上下移动

    /// <summary> /// 上移 /// </summary> /// <param name="sender"></param& ...