|
@@ -80,50 +80,56 @@ public class CashOutOrdersRsp {
|
|
|
public CashOutOrdersRsp(CashOutOrdersRsp item){
|
|
|
this.id=item.id;
|
|
|
this.entryTime=item.entryTime;
|
|
|
- this.entryTimeStr=item.entryTimeStr;
|
|
|
+// this.entryTimeStr=item.entryTimeStr;
|
|
|
// this.synOrderTime=item.synOrderTime;
|
|
|
- this.synOrderTimeStr="";
|
|
|
+ this.synOrderTimeStr=item.synOrderTimeStr;
|
|
|
// this.type=item.type;
|
|
|
- this.typeName="";
|
|
|
+ this.typeName=item.typeName;
|
|
|
this.orderCode=item.orderCode;
|
|
|
}
|
|
|
|
|
|
- public List<CashOutOrdersRsp> initSet(){
|
|
|
- if(entryTime !=null)
|
|
|
- entryTimeStr=df.format(entryTime);
|
|
|
- if(synOrderTime !=null)
|
|
|
- synOrderTimeStr=df.format(synOrderTime);
|
|
|
- if(type!=null && type>0)
|
|
|
- typeName=typeMap.get(type);
|
|
|
- if(status!=null && status>0)
|
|
|
- statusName=statusMap.get(status);
|
|
|
- if(paidPrice!=null && paidPrice>0)
|
|
|
- paidPriceOfYuan=decimalFormat.format(paidPrice/100D);
|
|
|
- if(price!=null && price>0)
|
|
|
- priceOfYuan=decimalFormat.format(price/100D);
|
|
|
- this.gross=0D;
|
|
|
- List<CashOutOrdersRsp> newOrders=new ArrayList<>();
|
|
|
- if(type!=null && type.equals(2) && StringUtils.isNotEmpty(drugs)){
|
|
|
- JSONArray jsonArray=JSONArray.parseArray(drugs);
|
|
|
- if(jsonArray!=null && jsonArray.size()>0){
|
|
|
- JSONObject one=jsonArray.getJSONObject(0);
|
|
|
- this.drugId=one.getString("drugId");
|
|
|
- this.drugName=one.getString("drugName");
|
|
|
- this.quantity=one.getInteger("quantity");
|
|
|
- this.costPrice=one.getDouble("price");
|
|
|
- this.retailPrice=one.getDouble("retailPrice");
|
|
|
- this.gross=((int)((this.retailPrice-this.costPrice)/this.retailPrice*100))/100D;
|
|
|
- CashOutOrdersRsp newCashOut;
|
|
|
- for(int i=1;i<jsonArray.size();i++){
|
|
|
- one=jsonArray.getJSONObject(i);
|
|
|
- newCashOut=new CashOutOrdersRsp(this);
|
|
|
- newCashOut.setDrugId(one.getString("drugId"));
|
|
|
- newCashOut.setDrugName(one.getString("drugName"));
|
|
|
- newCashOut.setQuantity(one.getInteger("quantity"));
|
|
|
- newCashOut.setCostPrice(one.getDouble("price"));
|
|
|
- newCashOut.setRetailPrice(one.getDouble("retailPrice"));
|
|
|
- newCashOut.setGross(((int)((newCashOut.retailPrice-newCashOut.costPrice)/newCashOut.retailPrice*100))/100D);
|
|
|
- newOrders.add(newCashOut);
|
|
|
+ public List<CashOutOrdersRsp> initSet() {
|
|
|
+ if (entryTime != null)
|
|
|
+ entryTimeStr = df.format(entryTime);
|
|
|
+ if (synOrderTime != null)
|
|
|
+ synOrderTimeStr = df.format(synOrderTime);
|
|
|
+ if (type != null && type > 0)
|
|
|
+ typeName = typeMap.get(type);
|
|
|
+ if (status != null && status > 0)
|
|
|
+ statusName = statusMap.get(status);
|
|
|
+ if (paidPrice != null && paidPrice > 0)
|
|
|
+ paidPriceOfYuan = decimalFormat.format(paidPrice / 100D);
|
|
|
+ if (price != null && price > 0)
|
|
|
+ priceOfYuan = decimalFormat.format(price / 100D);
|
|
|
+ this.gross = 0D;
|
|
|
+ List<CashOutOrdersRsp> newOrders = new ArrayList<>();
|
|
|
+ if (type != null) {
|
|
|
+ if (type.equals(1)) {
|
|
|
+ this.retailPrice=this.paidPrice/100D;
|
|
|
+ this.quantity=1;
|
|
|
+ this.drugName="在线问诊";
|
|
|
+ } else if (type.equals(2) && StringUtils.isNotEmpty(drugs)) {
|
|
|
+ JSONArray jsonArray = JSONArray.parseArray(drugs);
|
|
|
+ if (jsonArray != null && jsonArray.size() > 0) {
|
|
|
+ JSONObject one = jsonArray.getJSONObject(0);
|
|
|
+ this.drugId = one.getString("drugId");
|
|
|
+ this.drugName = one.getString("drugName");
|
|
|
+ this.quantity = one.getInteger("quantity");
|
|
|
+ this.costPrice = one.getDouble("price");
|
|
|
+ this.retailPrice = one.getDouble("retailPrice");
|
|
|
+ this.gross = ((int) ((this.retailPrice - this.costPrice) / this.retailPrice * 100)) / 100D;
|
|
|
+ CashOutOrdersRsp newCashOut;
|
|
|
+ for (int i = 1; i < jsonArray.size(); i++) {
|
|
|
+ one = jsonArray.getJSONObject(i);
|
|
|
+ newCashOut = new CashOutOrdersRsp(this);
|
|
|
+ newCashOut.setDrugId(one.getString("drugId"));
|
|
|
+ newCashOut.setDrugName(one.getString("drugName"));
|
|
|
+ newCashOut.setQuantity(one.getInteger("quantity"));
|
|
|
+ newCashOut.setCostPrice(one.getDouble("price"));
|
|
|
+ newCashOut.setRetailPrice(one.getDouble("retailPrice"));
|
|
|
+ newCashOut.setGross(((int) ((newCashOut.retailPrice - newCashOut.costPrice) / newCashOut.retailPrice * 100)) / 100D);
|
|
|
+ newOrders.add(newCashOut);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|