| | |
| | | import java.rmi.NoSuchObjectException; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | import java.util.*; |
| | | import java.util.concurrent.locks.Lock; |
| | | import java.util.concurrent.locks.ReentrantLock; |
| | | |
| | |
| | | prefixMap.put("storePhotoId","41"); |
| | | prefixMap.put("storeCerdentialsId","42"); |
| | | prefixMap.put("memberStoreId","43"); |
| | | prefixMap.put("propertyStoreId","44"); |
| | | prefixMap.put("storeUserId","45"); |
| | | prefixMap.put("shopId","50"); |
| | | prefixMap.put("shopAttrId","51"); |
| | | prefixMap.put("shopPhotoId","52"); |
| | |
| | | prefixMap.put("commentScoreId","64"); |
| | | prefixMap.put("communityId","70"); |
| | | prefixMap.put("communityPhotoId","71"); |
| | | prefixMap.put("communityMemberId","72"); |
| | | prefixMap.put("agentId","80"); |
| | | prefixMap.put("agentIdPhotoId","81"); |
| | | prefixMap.put("agentPhotoId","81"); |
| | | prefixMap.put("agentCerdentialsId","82"); |
| | | prefixMap.put("agentUserId","83"); |
| | | prefixMap.put("propertyId","90"); |
| | | prefixMap.put("propertyIdPhotoId","91"); |
| | | prefixMap.put("propertyPhotoId","91"); |
| | | prefixMap.put("propertyCerdentialsId","92"); |
| | | prefixMap.put("propertyUserId","93"); |
| | | prefixMap.put("propertyFeeId","94"); |
| | | prefixMap.put("houseId","95"); |
| | | } |
| | | |
| | | private static String PLATFORM_CODE = "0001"; |
| | |
| | | count = lastCount++; |
| | | } finally { |
| | | LOCK.unlock(); |
| | | return String.format(idLength, count); |
| | | return getRandom()+String.format(idLength, count); |
| | | } |
| | | } |
| | | |
| | | public static String nextId(){ |
| | | return nextId("%06d"); |
| | | return nextId("%04d"); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | public static String getOId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("oId") + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H) + nextId("%08d"); |
| | | return prefixMap.get("oId") + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H) + nextId("%04d"); |
| | | } |
| | | return getCode(prefixMap.get("oId")); |
| | | } |
| | |
| | | |
| | | public static String getBId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("bId") + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H) + nextId("%08d"); |
| | | return prefixMap.get("bId") + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H) + nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("bId")); |
| | |
| | | |
| | | public static String getAttrId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("attrId") + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H) + nextId("%08d"); |
| | | return prefixMap.get("attrId") + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H) + nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("attrId")); |
| | |
| | | |
| | | public static String getUserId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("userId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("userId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("userId")); |
| | |
| | | |
| | | public static String getStoreId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("storeId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("storeId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("storeId")); |
| | |
| | | |
| | | public static String getMemberStoreId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("memberStoreId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("memberStoreId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("memberStoreId")); |
| | |
| | | |
| | | public static String getStorePhotoId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("storePhotoId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("storePhotoId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("storePhotoId")); |
| | |
| | | */ |
| | | public static String getStoreCerdentialsId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("storeCerdentialsId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("storeCerdentialsId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("storeCerdentialsId")); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @return |
| | | * @throws GenerateCodeException |
| | | */ |
| | | public static String getStoreUserId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("storeUserId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("storeUserId")); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public static String getCommunityId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("communityId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("communityId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("communityId")); |
| | |
| | | */ |
| | | public static String getCommunityPhotoId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("communityPhotoId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("communityPhotoId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("communityPhotoId")); |
| | | } |
| | | |
| | | /** |
| | | * 生成小区成员ID |
| | | * @return |
| | | * @throws GenerateCodeException |
| | | */ |
| | | public static String getCommunityMemberId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("communityMemberId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("communityMemberId")); |
| | | } |
| | | /** |
| | | * 获取小区ID |
| | | * @return |
| | |
| | | */ |
| | | public static String getAgentId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("agentId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("agentId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("agentId")); |
| | |
| | | */ |
| | | public static String getAgentPhotoId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("agentPhotoId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("agentPhotoId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("agentPhotoId")); |
| | |
| | | */ |
| | | public static String getAgentCerdentialsId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("agentCerdentialsId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("agentCerdentialsId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("agentCerdentialsId")); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @return |
| | | * @throws GenerateCodeException |
| | | */ |
| | | public static String getAgentUserId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("agentUserId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("agentUserId")); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public static String getPropertyId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("propertyId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("propertyId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("propertyId")); |
| | |
| | | */ |
| | | public static String getPropertyPhotoId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("propertyPhotoId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("propertyPhotoId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("propertyPhotoId")); |
| | |
| | | */ |
| | | public static String getPropertyCerdentialsId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("propertyCerdentialsId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("propertyCerdentialsId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("propertyCerdentialsId")); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @return |
| | | * @throws GenerateCodeException |
| | | */ |
| | | public static String getPropertyUserId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("propertyUserId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("propertyUserId")); |
| | | } |
| | | |
| | | /** |
| | | * 物业费用ID生成 |
| | | * @return |
| | | * @throws GenerateCodeException |
| | | */ |
| | | public static String getPropertyFeeId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("propertyFeeId") + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H+nextId("%04d")); |
| | | } |
| | | |
| | | return getCode(prefixMap.get("propertyFeeId")); |
| | | } |
| | | |
| | | /** |
| | | * 住户ID生成 |
| | | * @return |
| | | * @throws GenerateCodeException |
| | | */ |
| | | public static String getHouseId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("houseId") + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H+nextId("%04d")); |
| | | } |
| | | |
| | | return getCode(prefixMap.get("houseId")); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | public static String getShopId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("shopId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("shopId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("shopId")); |
| | |
| | | */ |
| | | public static String getShopAttrId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("shopAttrId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("shopAttrId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("shopAttrId")); |
| | |
| | | */ |
| | | public static String getShopPreferentialId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("shopPreferentialId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("shopPreferentialId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("shopPreferentialId")); |
| | |
| | | */ |
| | | public static String getShopAttrParamId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("shopAttrParamId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("shopAttrParamId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("shopAttrParamId")); |
| | |
| | | */ |
| | | public static String getCommentPhotoId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("commentPhotoId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("commentPhotoId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("commentPhotoId")); |
| | |
| | | */ |
| | | public static String getShopPhotoId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("shopPhotoId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("shopPhotoId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("shopPhotoId")); |
| | |
| | | */ |
| | | public static String getShopDescId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("shopDescId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("shopDescId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("shopDescId")); |
| | |
| | | */ |
| | | public static String getShopCatalogId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("shopCatalogId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("shopCatalogId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("shopCatalogId")); |
| | |
| | | */ |
| | | public static String getShopBuyId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("buyId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("buyId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("buyId")); |
| | |
| | | */ |
| | | public static String getShopBuyAttrId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("buyAttrId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("buyAttrId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("buyAttrId")); |
| | |
| | | */ |
| | | public static String getCommentId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("commentId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("commentId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("commentId")); |
| | |
| | | */ |
| | | public static String getSubCommentId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("subCommentId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("subCommentId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("subCommentId")); |
| | |
| | | */ |
| | | public static String getSubCommentAttrId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("subCommentAttrId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("subCommentAttrId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("subCommentAttrId")); |
| | |
| | | */ |
| | | public static String getCommentScoreId() throws GenerateCodeException{ |
| | | if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){ |
| | | return prefixMap.get("commentScoreId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%06d"); |
| | | return prefixMap.get("commentScoreId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d"); |
| | | } |
| | | //调用服务 |
| | | return getCode(prefixMap.get("commentScoreId")); |
| | |
| | | paramOut.put("requestTime",DateUtil.getNowDefault()); |
| | | return paramOut; |
| | | } |
| | | |
| | | /** |
| | | * 获取随机数 |
| | | * @return |
| | | */ |
| | | private static String getRandom(){ |
| | | Random random = new Random(); |
| | | String result=""; |
| | | for (int i=0;i<4;i++) |
| | | { |
| | | result+=random.nextInt(10); |
| | | } |
| | | return result; |
| | | } |
| | | } |