保存进度
This commit is contained in:
		@@ -47,7 +47,7 @@ public class CpicximToXMNHS
 | 
				
			|||||||
    private static String password   = "Kane@1981";
 | 
					    private static String password   = "Kane@1981";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * 从数据库中获取未发送过的小药箱数据。
 | 
					     * 从HmbXyxInfo_Update中获取未发送过的小药箱数据。
 | 
				
			||||||
     * 
 | 
					     * 
 | 
				
			||||||
     * @return
 | 
					     * @return
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
@@ -139,6 +139,11 @@ public class CpicximToXMNHS
 | 
				
			|||||||
        return items;
 | 
					        return items;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 将 postedItems 中的小药箱数据,冲HmbXyxInfo_update中清除。
 | 
				
			||||||
 | 
					     * 
 | 
				
			||||||
 | 
					     * @param postedItems 已发送的小药箱数据
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    public static void removePostedHmbXyxInfo( Vector<HmbXyxInfo> postedItems )
 | 
					    public static void removePostedHmbXyxInfo( Vector<HmbXyxInfo> postedItems )
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        Vector<HmbXyxInfo> items = new Vector<HmbXyxInfo>();
 | 
					        Vector<HmbXyxInfo> items = new Vector<HmbXyxInfo>();
 | 
				
			||||||
@@ -286,19 +291,26 @@ public class CpicximToXMNHS
 | 
				
			|||||||
                try
 | 
					                try
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    logger.info( "发送请求内容:" + requestObject.toJSONString() );
 | 
					                    logger.info( "发送请求内容:" + requestObject.toJSONString() );
 | 
				
			||||||
                    
 | 
					
 | 
				
			||||||
                    req.setData( requestObject );
 | 
					                    req.setData( requestObject );
 | 
				
			||||||
                    resp = client.execute( req );
 | 
					                    resp = client.execute( req );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    logger.info( "发送成功,返回消息:" + resp.getData() );
 | 
					                    if ( resp != null )
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        logger.info( "发送成功,返回消息:" + resp.getData() );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    // 将已发送的数据从update表中清理掉
 | 
					                        // 将已发送的数据从HmbXyxInfo_update表中清理掉
 | 
				
			||||||
                    removePostedHmbXyxInfo( postedInfo );
 | 
					                        removePostedHmbXyxInfo( postedInfo );
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        logger.info( "已发送请求,但获取的DefaultZephyrResponse为null!" );
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                catch ( ZephyrApiException error )
 | 
					                catch ( ZephyrApiException error )
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    // 发送不成功,记录日志
 | 
					                    // 发送不成功,记录日志
 | 
				
			||||||
                    // 失败的数据就留在update表中,待以后重新发送
 | 
					                    // 不从HmbXyxInfo_update中清理当前这批数据,待以后重新发送
 | 
				
			||||||
                    logger.error( "发送异常:" + error.getMessage() );
 | 
					                    logger.error( "发送异常:" + error.getMessage() );
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                finally
 | 
					                finally
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user