Atitit. atiOrder Order 订单管理框架的设计
Atitit. atiOrder Order 订单管理框架的设计
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 订单管理框架的设计的更多相关文章
- SAP CRM系统订单模型的设计与实现
SAP成都研究院的一个部门领导让我给他的团队做一个SAP CRM One Order框架的培训,这是我准备的培训内容. 在Jerry之前的文章 基于SAP Kyma的订单编排增强介绍,我表达了自己对S ...
- Atitit.cateService分类管理新特性与设计文档说明v1
Atitit.cateService分类管理新特性与设计文档说明v1 1. V2 新特性规划1 2. 分类管理1 3. 分类增加与修改维护2 4. Js控件分类数据绑定2 1. V2 新特性规划 增加 ...
- atitit.atiOrmStoreService 框架的原理与设计 part1 概述与新特性
atitit.atiOrmStoreService 框架的原理与设计 part1 概述与新特性 1. 新特性如下 支持生成sql在无数据库连接的情况下 2. Orm设计 主要的俩个以来service ...
- Atitit. 数据库-----catalog与schema的设计区别以及在实际中使用 获取数据库所有库表 java jdbc php c#.Net
Atitit. 数据库-----catalog与schema的设计区别以及在实际中使用 获取数据库所有库表 java jdbc php c#.Net 1. -catalog与schema的设计区别1 ...
- Atitit.加密算法ati Aes的框架设计
Atitit.加密算法ati Aes的框架设计 版本进化 c:\1t\aesC47.java c:\1t\aes.java 增加了public static byte[] encrypt(byte[] ...
- 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 ...
- Atitit 修改密码的功能流程设计 attilax总结
Atitit 修改密码的功能流程设计 attilax总结 1.1. 注意点1 1.2. 设计修改用户密码功能时把用户ID保存在哪里?1 1.3. Ui设计1 1.4. 功能设计源码1 1.5. Agt ...
- atitit. 日志系统的原则and设计and最佳实践(1)-----原理理论总结.
atitit. 日志系统的原则and设计and最佳实践总结. 1. 日志系统是一种不可或缺的单元测试,跟踪调试工具 1 2. 日志系统框架通常应当包括如下基本特性 1 1. 所输出的日志拥有自己的分类 ...
- atitit.基于http json api 接口设计 最佳实践 总结o7
atitit.基于http json api 接口设计 最佳实践 总结o7 1. 需求:::服务器and android 端接口通讯 2 2. 接口开发的要点 2 2.1. 普通参数 meth,p ...
随机推荐
- RPD Volume 168 Issue 4 March 2016 评论7-end
Shielding activation of petawatt laser facilities in Romania: a FLUKA preliminary evaluation Abstr ...
- CodeChef - UASEQ Chef and sequence
Read problems statements in Mandarin Chinese and Russian. You are given an array that consists of n ...
- jvm-监控指令-jdump
格式: jmap [option] vmid 作用: 生成堆转储快照. 使用:(注意:需要使用工具打开,分析. 比如: EclipseMemoryAnalyzer)
- Visio插入竖直省略号
不去想省略号,想效果,插入文本框,输入点号,换行,三次就ok.
- 修改input type=file 标签默认样式的简单方法
<html><head><title></title></head><body><form id="upload ...
- 在Windows平台下安装与配置Memcached及C#使用方法
1.在Windows下安装Memcached 资料来源:http://www.jb51.net/article/30334.htm 在Windows平台下安装与配置Memcached的方法,Memca ...
- linux:使用comm命令比较两个文件:交集、差
linux:使用comm命令比较两个文件:交集.差 comm命令可以按行比较两个排序好的文件,输出有3列:第一列是file1独有的.第二列是file2独有的,第三列是两者都有的,简单语法如下:NAME ...
- ylbtech-dbs-m-YinTai(银泰网)
ylbtech-dbs:ylbtech-dbs-m-YinTai(银泰网) -- =============================================-- DatabaseNam ...
- 异常值监测的方法 Tukey test
参考: https://www.zhihu.com/question/38066650
- 防止木马利用iframe框架来调用外域JS代码
<!--防止木马利用iframe框架来调用外域JS代码,不过滤自己网站的域名的框架网页开始--><SCRIPT LANGUAGE="JavaScript"> ...