Sfoglia il codice sorgente

改造订单服务测试完成

wuxw 7 anni fa
parent
commit
97b45f5bb8

+ 4 - 4
Api/src/main/java/com/java110/api/listener/AbstractServiceApiDataFlowListener.java

@@ -210,18 +210,18 @@ public abstract class AbstractServiceApiDataFlowListener implements ServiceDataF
         for(String key : headers.keySet()){
 
             if(CommonConstant.HTTP_APP_ID.equals(key)) {
-                httpHeaders.add("appId", headers.get(key));
+                httpHeaders.add("app_id", headers.get(key));
             }
             if(CommonConstant.HTTP_TRANSACTION_ID.equals(key)) {
-                httpHeaders.add("transactionId", headers.get(key));
+                httpHeaders.add("transaction_id", headers.get(key));
             }
 
             if(CommonConstant.HTTP_REQ_TIME.equals(key)) {
-                httpHeaders.add("requestTime", headers.get(key));
+                httpHeaders.add("req_time", headers.get(key));
             }
 
             if(CommonConstant.HTTP_USER_ID.equals(key)){
-                httpHeaders.add("userId",headers.get(key));
+                httpHeaders.add("user_id",headers.get(key));
             }
         }
 

+ 1 - 1
OrderService/src/main/java/com/java110/order/smo/impl/CenterServiceCacheSMOImpl.java

@@ -179,7 +179,7 @@ public class CenterServiceCacheSMOImpl implements ICenterServiceCacheSMO {
             return;
         }
         //删除原始数据
-        ServiceSqlCache.removeData(ServiceBusinessCache._KEY_SERVICE_BUSINESS);
+        ServiceBusinessCache.removeData(ServiceBusinessCache._KEY_SERVICE_BUSINESS);
 
         //设置缓存
         ServiceBusinessCache.setServiceBusiness(serviceBusinesses);

+ 4 - 4
OrderService/src/main/java/com/java110/order/smo/impl/OrderServiceSMOImpl.java

@@ -883,17 +883,17 @@ public class OrderServiceSMOImpl implements IOrderServiceSMO {
             if(urls.length != 2){
                 throw new ConfigDataException(ResponseConstant.RESULT_CODE_CONFIG_ERROR,"配置错误:c_service_business配置url字段错误"+serviceBusiness.getBusinessTypeCd());
             }
-            String webserviceUrl = CodeMapUtil.getDynamicConstantValue(urls[0]);
-            String method = CodeMapUtil.getDynamicConstantValue(urls[1]);
+            String webserviceUrl = MappingCache.getValue(urls[0]);
+            String method = MappingCache.getValue(urls[1]);
             responseMessage = (String) WebServiceAxisClient.callWebService(webserviceUrl,method,
                     new Object[]{requestBusinessJson.toJSONString()},
                     serviceBusiness.getTimeout());
         }else if(ServiceBusinessConstant.INVOKE_TYPE_HTTP_POST.equals(serviceBusiness.getInvokeType())){
             //http://user-service/test/sayHello
-            String httpPostUrl = CodeMapUtil.getDynamicConstantValue(serviceBusiness.getUrl());
+            String httpPostUrl = MappingCache.getValue(serviceBusiness.getUrl());
             responseMessage = restTemplate.postForObject(httpPostUrl,requestBusinessJson.toJSONString(),String.class);
         }else if(ServiceBusinessConstant.INVOKE_TYPE_OUT_HTTP_POST.equals(serviceBusiness.getInvokeType())){
-            String httpPostUrl = CodeMapUtil.getDynamicConstantValue(serviceBusiness.getUrl());
+            String httpPostUrl = MappingCache.getValue(serviceBusiness.getUrl());
             responseMessage = restTemplateNoLoadBalanced.postForObject(httpPostUrl,requestBusinessJson.toJSONString(),String.class);
         }
         else {//post方式

+ 3 - 3
java110-bean/src/main/java/com/java110/entity/order/Orders.java

@@ -32,7 +32,7 @@ public class Orders extends BaseOrder{
     /**
      * 外部系统请求时间
      */
-    private Date requestTime;
+    private String requestTime;
 
 
     /**
@@ -77,11 +77,11 @@ public class Orders extends BaseOrder{
         this.userId = userId;
     }
 
-    public Date getRequestTime() {
+    public String getRequestTime() {
         return requestTime;
     }
 
-    public void setRequestTime(Date requestTime) {
+    public void setRequestTime(String requestTime) {
         this.requestTime = requestTime;
     }
 

+ 3 - 1
java110-bean/src/main/java/com/java110/entity/order/ServiceBusiness.java

@@ -1,11 +1,13 @@
 package com.java110.entity.order;
 
+import java.io.Serializable;
+
 /**
  * @author wux
  * @create 2019-02-05 下午10:22
  * @desc 服务业务类
  **/
-public class ServiceBusiness {
+public class ServiceBusiness implements Serializable {
 
     private long serviceBusinessId;
 

+ 3 - 1
java110-common/src/main/java/com/java110/common/util/CodeMapUtil.java

@@ -17,10 +17,12 @@ import java.util.List;
 /**
  * 类名称:CodeMapUtil
  * 类描述:
- * 创建人:吴学文
+ * 创建人:wuxw
  * 创建时间:2017-3-1
  */
 @SuppressWarnings("unchecked")
+
+@Deprecated
 public class CodeMapUtil extends LoggerEngine {
 
 

+ 5 - 5
java110-config/src/main/resources/mapper/service/QueryServiceDAOImplMapper.xml

@@ -21,14 +21,14 @@
         <parameter property="resMsg" javaType="java.lang.String" jdbcType="CLOB" mode="OUT" />
     </parameterMap>
 
-    <resultMap type="com.java110.entity.service.ServiceSql" id="serviceBusinessMap">
-        <result column="service_business_id" jdbcType="INT" property="serviceBusinessId"/>
-        <result column="business_type_cd" jdbcType="VARCHAR" property="serviceTypeCd"/>
+    <resultMap type="com.java110.entity.order.ServiceBusiness" id="serviceBusinessMap">
+        <result column="service_business_id" jdbcType="INTEGER" property="serviceBusinessId"/>
+        <result column="business_type_cd" jdbcType="VARCHAR" property="businessTypeCd"/>
         <result column="invoke_type" jdbcType="VARCHAR" property="invokeType"/>
         <result column="url" jdbcType="VARCHAR" property="url"/>
         <result column="message_topic" jdbcType="VARCHAR" property="messageTopic"/>
-        <result column="timeout" jdbcType="INT" property="timeout"/>
-        <result column="retry_count" jdbcType="INT" property="retryCount"/>
+        <result column="timeout" jdbcType="INTEGER" property="timeout"/>
+        <result column="retry_count" jdbcType="INTEGER" property="retryCount"/>
     </resultMap>
 
     <!--执行查询sql -->

+ 2 - 0
java110-core/src/main/java/com/java110/core/context/AbstractOrderDataFlowContext.java

@@ -15,6 +15,8 @@ import java.util.*;
  */
 public abstract class AbstractOrderDataFlowContext extends AbstractDataFlowContextPlus implements IOrderDataFlowContext{
 
+    protected AbstractOrderDataFlowContext(){}
+
     protected AbstractOrderDataFlowContext(Date startDate, String code){}
 
     /**

+ 5 - 4
java110-core/src/main/java/com/java110/core/context/OrderDataFlow.java

@@ -18,8 +18,9 @@ import java.util.*;
  */
 public class OrderDataFlow extends AbstractOrderDataFlowContext {
 
+    public OrderDataFlow(){}
 
-    protected OrderDataFlow(Date startDate, String code) {
+    public OrderDataFlow(Date startDate, String code) {
         super(startDate, code);
     }
 
@@ -73,7 +74,7 @@ public class OrderDataFlow extends AbstractOrderDataFlowContext {
         Assert.isJsonObject(reqInfo,"当前报文不是有效json,请检查"+reqInfo);
          this.setDataFlowId(UUID.randomUUID().toString().replace("-","").toLowerCase());
         //赋值请求报文
-        this.setResJson(JSONObject.parseObject(reqInfo));
+        this.setReqJson(JSONObject.parseObject(reqInfo));
         //赋值 请求头信息
         this.setReqHeaders(headerAll);
 
@@ -123,7 +124,7 @@ public class OrderDataFlow extends AbstractOrderDataFlowContext {
 
         Assert.isDate(this.getReqHeaders().get(CommonConstant.HTTP_REQ_TIME),"构建OrderDataFlow对象失败,请求头中"+CommonConstant.HTTP_REQ_TIME+"格式错误");
 
-        this.orders.setRequestTime(DateUtil.getDefaultDateFromString(this.getReqHeaders().get(CommonConstant.HTTP_REQ_TIME)));
+        this.orders.setRequestTime(this.getReqHeaders().get(CommonConstant.HTTP_REQ_TIME));
 
         this.orders.setoId("-1");
 
@@ -160,7 +161,7 @@ public class OrderDataFlow extends AbstractOrderDataFlowContext {
 
         this.businessList = new ArrayList<Business>();
 
-        JSONArray tmpBusiness = this.getResJson().getJSONArray("business");
+        JSONArray tmpBusiness = this.getReqJson().getJSONArray("business");
 
         Business business = null;
         for (int tmpBusinessIndex = 0;tmpBusinessIndex < tmpBusiness.size();tmpBusinessIndex++){

+ 52 - 41
java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java

@@ -15,10 +15,7 @@ import org.springframework.web.client.RestTemplate;
 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;
 
@@ -96,12 +93,12 @@ public class GenerateCodeFactory {
             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");
     }
 
     /**
@@ -139,7 +136,7 @@ public class GenerateCodeFactory {
 
     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"));
     }
@@ -181,7 +178,7 @@ public class GenerateCodeFactory {
 
     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"));
@@ -189,7 +186,7 @@ public class GenerateCodeFactory {
 
     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"));
@@ -208,7 +205,7 @@ public class GenerateCodeFactory {
 
     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"));
@@ -217,7 +214,7 @@ public class GenerateCodeFactory {
 
     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"));
@@ -225,7 +222,7 @@ public class GenerateCodeFactory {
 
     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"));
@@ -234,7 +231,7 @@ public class GenerateCodeFactory {
 
     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"));
@@ -247,7 +244,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -261,7 +258,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -275,7 +272,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -288,7 +285,7 @@ public class GenerateCodeFactory {
      */
     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("%06d");
+            return prefixMap.get("communityMemberId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d");
         }
         //调用服务
         return getCode(prefixMap.get("communityMemberId"));
@@ -300,7 +297,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -314,7 +311,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -327,7 +324,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -342,7 +339,7 @@ public class GenerateCodeFactory {
      */
     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("%06d");
+            return prefixMap.get("agentUserId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d");
         }
         //调用服务
         return getCode(prefixMap.get("agentUserId"));
@@ -356,7 +353,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -370,7 +367,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -383,7 +380,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -397,7 +394,7 @@ public class GenerateCodeFactory {
      */
     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("%06d");
+            return prefixMap.get("propertyUserId") +DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H)+ nextId("%04d");
         }
         //调用服务
         return getCode(prefixMap.get("propertyUserId"));
@@ -410,7 +407,7 @@ public class GenerateCodeFactory {
      */
     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("%06d"));
+            return prefixMap.get("propertyFeeId") + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H+nextId("%04d"));
         }
 
         return getCode(prefixMap.get("propertyFeeId"));
@@ -423,7 +420,7 @@ public class GenerateCodeFactory {
      */
     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("%06d"));
+            return prefixMap.get("houseId") + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H+nextId("%04d"));
         }
 
         return getCode(prefixMap.get("houseId"));
@@ -438,7 +435,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -451,7 +448,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -464,7 +461,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -479,7 +476,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -491,7 +488,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -507,7 +504,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -520,7 +517,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -533,7 +530,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -546,7 +543,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -559,7 +556,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -572,7 +569,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -585,7 +582,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -598,7 +595,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -610,7 +607,7 @@ public class GenerateCodeFactory {
      */
     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"));
@@ -665,4 +662,18 @@ public class GenerateCodeFactory {
         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;
+    }
 }

+ 5 - 3
java110-core/src/main/java/com/java110/core/factory/OrderDataFlowContextFactory.java

@@ -388,6 +388,11 @@ public class OrderDataFlowContextFactory {
         List<Map> orderAttrs = new ArrayList<Map>();
 
         List<OrdersAttrs> attrs = orders.getOrdersAttrs();
+
+        if(attrs == null || attrs.size() == 0){
+            return orderAttrs;
+        }
+
         Map attrMap = null;
         for(OrdersAttrs ordersAttr:attrs)
         {
@@ -694,13 +699,10 @@ public class OrderDataFlowContextFactory {
      * @return
      */
     public static List<com.java110.entity.order.Business> getSynchronousBusinesses(IOrderDataFlowContext dataFlow){
-        AppService service = null;
-        AppRoute route = null;
         List<com.java110.entity.order.Business> syschronousBusinesses = new ArrayList<com.java110.entity.order.Business>();
         for(com.java110.entity.order.Business business :dataFlow.getBusinessList()){
 
             if(CommonConstant.ORDER_INVOKE_METHOD_SYNCHRONOUS.equals(business.getInvokeModel()) || StringUtil.isEmpty(business.getInvokeModel())){
-                business.setSeq(service.getSeq());
                 syschronousBusinesses.add(business);
             }
         }