Browse Source

修正取金额的bug

master
xyiege 4 years ago
parent
commit
28dbe47099
  1. 11
      src/main/java/cn/chjyj/szwh/bean/Order.java
  2. 24
      src/main/java/cn/chjyj/szwh/service/impl/OrderServiceImpl.java
  3. 2
      src/main/resources/mapper/szwh/OrderMapper.xml

11
src/main/java/cn/chjyj/szwh/bean/Order.java

@ -25,7 +25,8 @@ public class Order implements Serializable {
private String historyBuyName; // 历史购买方名称
private String historyBuyCode; // 历史购买方组织机构代码
private BigDecimal totalServiceCharge; //订单服务费金额
private BigDecimal totalMoney; //订单总金额
private BigDecimal goodsPrice;// 订单价格
private BigDecimal totalMoney; //订单总金额 包含服务费
private Integer type;//订单类型;1:委托订单;2:认证订单;3:服务订单
private Integer status;//订单状态;1:待付款;2:待交付;3:待结算;4:已完成;5:已关闭;
private String transactionIslicode; //交易isli标识码
@ -114,6 +115,14 @@ public class Order implements Serializable {
this.totalServiceCharge = totalServiceCharge;
}
public BigDecimal getGoodsPrice() {
return goodsPrice;
}
public void setGoodsPrice(BigDecimal goodsPrice) {
this.goodsPrice = goodsPrice;
}
public BigDecimal getTotalMoney() {
return totalMoney;
}

24
src/main/java/cn/chjyj/szwh/service/impl/OrderServiceImpl.java

@ -306,8 +306,8 @@ public class OrderServiceImpl implements OrderService {
// 订单基础信息 todo fix
Map bsodmap = new HashMap();
Order bsod = orderMapper.getOrderByBatchcode(bathcode);
bsodmap.put("goods_price","0.00");
bsodmap.put("total_service_charge","0.20");
bsodmap.put("goods_price",bsod.getGoodsPrice());
bsodmap.put("total_service_charge",bsod.getTotalServiceCharge());
retmap.put("order",bsodmap);
@ -324,7 +324,8 @@ public class OrderServiceImpl implements OrderService {
String goodsType="";//产品类型
List<String> goodsEntrust=new ArrayList<>();
String goodsOwnerShipStr="";
BigDecimal goodsPrice=new BigDecimal(0); // 订单金额
//BigDecimal goodsPrice=new BigDecimal(0); // 订单金额
BigDecimal price = new BigDecimal(0);
int transactionCount=0;// 交易次数
BigDecimal earnestMoney= new BigDecimal(0);
BigDecimal serviceCharge=new BigDecimal(0);//服务
@ -345,19 +346,15 @@ public class OrderServiceImpl implements OrderService {
//
goodsOwnerShipStr += odg.getGoodsOwnershipStr()+",";
// 用字符串形式保持精度
// BigDecimal gprice = new BigDecimal(odg.getPrice().toString());
// price = price.add(gprice);
// 订单总额
goodsPrice=goodsPrice.add(odg.getGoodsPrice());
price = price.add(odg.getPrice());
// 交易数量
transactionCount+=odg.getTransactionCount();
//
BigDecimal gear=new BigDecimal(odg.getEarnestMoney().toString());
earnestMoney=earnestMoney.add(gear);
//
BigDecimal gsercharge= new BigDecimal(odg.getServiceCharge().toString());
serviceCharge=serviceCharge.add(gsercharge);
serviceCharge=serviceCharge.add(odg.getServiceCharge());
//
contractCode+=odg.getContractCode()+",";
//
@ -390,13 +387,10 @@ public class OrderServiceImpl implements OrderService {
//
odinfoMap.put("goods_ownership_str",goodsOwnerShipStr.substring(0,goodsOwnerShipStr.length()-1));
//标的价格
odinfoMap.put("price",goodsPrice);
odinfoMap.put("price",price);
odinfoMap.put("transaction_count",transactionCount);
odinfoMap.put("earnest_money",earnestMoney);
odinfoMap.put("service_charge",serviceCharge);
//订单金额总额
odinfoMap.put("total_money",bsod.getTotalMoney());
retmap.put("order_info",odinfoMap);
//购买者

2
src/main/resources/mapper/szwh/OrderMapper.xml

@ -6,7 +6,7 @@
<sql id="column">
cast(id as char) as id,user_id as userId,buy_islicode as buyIslicode,batchcode,account_ratio_id as accountRatioId,
history_buy_name as historyBuyName,
history_buy_name as historyBuyName,goods_price as goodsPrice
history_buy_code as historyBuyCode,total_service_charge as totalServiceCharge,total_money as totalMoney,
`type`,`status`,transaction_islicode as transactionIslicode,ticketid,ticketmoney,ticketurl,ticketimage,
ticket_status as ticketStatus,charge_channel as chargeChannel,pay_status as payStatus,close_status as closeStatus,

Loading…
Cancel
Save