Administrator
2018-11-29 ebb3551170b255defc25fe93bbf6eb1e84cd321d
fanli/src/main/java/com/yeshi/fanli/service/impl/hongbao/ThreeSaleSerivceImpl.java
@@ -432,16 +432,11 @@
         // 邀请id
         object.put("inviteId", threeSale.getId());
         
         // 加入队列时间
         Long createTime = threeSale.getCreateTime();
         Date inviteTime = new Date(createTime);
         object.put("inviteTime", format.format(inviteTime) + " 加入");
         
         if (formatYears.format(todayTime).equals(formatYears.format(inviteTime))) {
            // 本年
            object.put("inviteTime", sdf.format(inviteTime) + " 加入");
         } else {
            // 往年
            object.put("inviteTime", format.format(inviteTime) + " 加入");
         }
         
         String memoName = "";
         ThreeSaleExtraInfo threeSaleExtraInfo = threeSale.getThreeSaleExtraInfo();
@@ -455,45 +450,48 @@
         String nickName = "";
         String portrait = "";
         Long lastLoginTime = null;
         Long workerId = null;
         
         UserInfo worker = threeSale.getWorker();
         if (worker != null) {
            workerId = worker.getId();
            portrait = worker.getPortrait();
            lastLoginTime = worker.getLastLoginTime();
            nickName = worker.getNickName();
         }
         object.put("nickName", nickName);
         object.put("workerId", workerId);
         object.put("portrait", portrait);
         
         int type = 0;
         int state = 0;
         String fontColor1 = "#888888";
         String fontColor2 = "#F14242";
         
         JSONArray array  = new JSONArray();
         if (threeSale.getState()) {
            type = 1;
            state = 1;
            if (lastLoginTime == null) {
               lastLoginTime = threeSale.getCreateTime();
            }
            
            JSONArray array1 = new JSONArray();
            array1.add(fontColor1);
            array1.add("最近登陆 " + sdf.format(lastLoginTime));
            JSONObject contentJson = new JSONObject();
            contentJson.put("color", fontColor1);
            
            array.add(array1);
            if (formatYears.format(todayTime).equals(formatYears.format(lastLoginTime))) {
               // 本年
               contentJson.put("content", "最近登陆 " + sdf.format(lastLoginTime));
            } else {
               // 往年
               contentJson.put("content", "最近登陆 " + format.format(lastLoginTime));
            }
            array.add(contentJson);
            
         } else if ( threeSale.getExpire()!= null && (threeSale.getExpire() == 1 || threeSale.getExpire().equals(1))) {
            type = 2;
            JSONArray array1 = new JSONArray();
            array1.add(fontColor1);
            array1.add("已经脱离邀请关系");
            array.add(array1);
            state = 2;
            JSONObject contentJson = new JSONObject();
            contentJson.put("color", fontColor1);
            contentJson.put("content", "已经脱离邀请关系");
            array.add(contentJson);
         } else {
            type = 0;
            state = 0;
            
            Calendar c = Calendar.getInstance();
            c.setTime(inviteTime);
@@ -505,24 +503,24 @@
               days = 0;
            }
            
            JSONArray array1 = new JSONArray();
            array1.add(fontColor1);
            array1.add("将于");
            JSONObject contentJson1 = new JSONObject();
            contentJson1.put("color", fontColor1);
            contentJson1.put("content", "将于");
            
            JSONArray array2 = new JSONArray();
            array2.add(fontColor2);
            array2.add(days+"天");
            JSONObject contentJson2 = new JSONObject();
            contentJson2.put("color", fontColor2);
            contentJson2.put("content", days+"天");
            
            JSONArray array3 = new JSONArray();
            array3.add(fontColor1);
            array3.add("后脱离邀请关系");
            JSONObject contentJson3 = new JSONObject();
            contentJson3.put("color", fontColor1);
            contentJson3.put("content", "后脱离邀请关系");
               
            array.add(array1);
            array.add(array2);
            array.add(array3);
            array.add(contentJson1);
            array.add(contentJson2);
            array.add(contentJson3);
         }
         
         object.put("type", type);
         object.put("state", state);
         object.put("recentMsg", array);
         
         resultArray.add(object);
@@ -532,8 +530,6 @@
      result.put("result_list", resultArray);
      
      return result;
   }
   
}