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. HDU 1251 统计难题 (字典树)(查询是否为前缀)

    统计难题 Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131070/65535 K (Java/Others)Total Submi ...

  2. 【pb_ds】bzoj1056 [HAOI2008]排名系统/bzoj1862 [Zjoi2006]GameZ游戏排名系统

    STL裸题,线下AC,bzoj无限RE ing…… #include<cstdio> #include<cctype> #include<iostream> #in ...

  3. Djanog|requirements.txt生成

    Django | requirement.txt 生成 pip django 1   pip 通常我们熟悉使用的都是 pip, 这个工具确实方便项目管理依赖包.当想把当前项目依赖的包的名称和版本导入指 ...

  4. SpringMVC(流程+第一个Demo)

    一.流程图 用户发送请求至前端控制器DispatcherServlet DispatcherServlet收到请求调用HandlerMapping处理器映射器. 处理器映射器根据请求url找到具体的处 ...

  5. iOS开发——Autolayout下动态调整单元格高度

    情景描述: 有时候我们希望更新某一个单元格的数据,通常的做法是使用reloadData方法更新整个单元格.但是对一些情况是不适用的或者说实现起来比较麻烦.比如说这种简单的"点开"一 ...

  6. [JQuery]用InsertAfter实现图片走马灯展示效果

    写在前面 最近一个搞美工的朋友让我给他写一个图片轮播的特效. 需求: 图片向左循环滚动. 图片滚动到中间高亮显示,并在下方显示照片人物对应的信息. 鼠标悬停止滚动. 鼠标离开开始滚动. 单击图片,图片 ...

  7. 【JSP EL】el表达式判断是否为null

    后台程序放入Model中,从前台el表达式取出来非常方便,但是如果需要处理 当数据为null的时候,怎么办,不为null的时候,怎么办:这个怎么处理呢? <span class="us ...

  8. AtomicInteger类的简单应用

    AtomicInteger,一个提供原子操作的Integer的类.在Java语言中,++i和i++操作并不是线程安全的,在使用的时候,不可避免的会用到synchronized关键字.而AtomicIn ...

  9. 刷新神经网络新深度:ImageNet计算机视觉挑战赛微软中国研究员夺冠

    微软亚洲研究院首席研究员孙剑 世界上最好计算机视觉系统有多精确?就在美国东部时间12月10日上午9时,ImageNet计算机视觉识别挑战赛结果揭晓——微软亚洲研究院视觉计算组的研究员们凭借深层神经网络 ...

  10. ylbtech-LanguageSamples-Arrays(数组)

    ylbtech-Microsoft-CSharpSamples:ylbtech-LanguageSamples-Arrays(数组) 1.A,示例(Sample) 返回顶部 “数组”示例 本示例介绍并 ...