소스 검색

收益提现

liaoyongfei 4 년 전
부모
커밋
8609ae9f8f

+ 1 - 2
ymall/src/main/java/com/liangjian11/ymall/service/impl/UserAccountProfitServiceImpl.java

@@ -22,7 +22,6 @@ import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
 
 @Service
 public class UserAccountProfitServiceImpl extends ServiceImpl<UserAccountProfitMapper, UserAccountProfit> implements UserAccountProfitService {
@@ -149,7 +148,7 @@ public class UserAccountProfitServiceImpl extends ServiceImpl<UserAccountProfitM
 
   @Override
   @Transactional
-  public ResultData editCashOutState(CashOutRecordStateReq req){
+  public synchronized ResultData editCashOutState(CashOutRecordStateReq req){
     if(req.getId()==null|| req.getId()<=0)
       return ResultData.getFailResult("id不能为空");
     if(req.getState()==null)

+ 45 - 39
ymall/src/main/java/com/liangjian11/ymall/view/CashOutOrdersRsp.java

@@ -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);
+          }
         }
       }
     }

+ 10 - 0
ymall/src/main/java/com/liangjian11/ymall/view/CashOutRecordStateReq.java

@@ -8,6 +8,8 @@ public class CashOutRecordStateReq {
   private Short state;
   private String reviewRemarks;
   private String processInstanceId;
+  private String userName;
+
 
   public Integer getId() {
     return id;
@@ -40,4 +42,12 @@ public class CashOutRecordStateReq {
   public void setProcessInstanceId(String processInstanceId) {
     this.processInstanceId = processInstanceId;
   }
+
+  public String getUserName() {
+    return userName;
+  }
+
+  public void setUserName(String userName) {
+    this.userName = userName;
+  }
 }