Package org.luke.ct.model

Examples of org.luke.ct.model.CarPhoneRelation


        // 清除使用亂數配對的記錄
        cprn_service.delete(cprn.getKey());

        filter = String.format("phoneID=='%s' && carID=='%s'", phoneID, carID);
        List<CarPhoneRelation> cpr_list = cpr_service.getPaginationData(filter).getResultList();
        CarPhoneRelation cpr = null;
        if (null != cpr_list && cpr_list.size() > 1) {
          throw new Error("連結資料異常:carID:" + carID + ", phoneID=" + phoneID);
        }

        // 曾經配對成功過
        if (null != cpr_list && cpr_list.size() == 1) {
          // 更新記錄
          cpr = cpr_list.get(0);
          cpr.setModTime(CTCommon.getNowTime());
          cpr_service.modify(cpr);
        }
        // 未曾配對成功過
        else {
          // 新增記錄
          cpr = new CarPhoneRelation();
          cpr.setCarID(carID);
          cpr.setPhoneID(phoneID);
          cpr.setAddTime(CTCommon.getNowTime());
          cpr_service.add(cpr);
        }
        return cpr;
      } else {
        throw new Error("找不到配對的randomID:" + randomID);
View Full Code Here

TOP

Related Classes of org.luke.ct.model.CarPhoneRelation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.