| 
					
				 | 
			
			
				@@ -56,32 +56,38 @@ public class SalesDetaiServicelImpl implements ISalesDetaiServicel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public Result getSalesDetaiData(JSONObject msg, HttpServletRequest httpServletRequest) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            String strMsg = httpServletRequest.getHeader("Sign"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            String tranDtion = httpServletRequest.getHeader("tranDtion")==null?"":httpServletRequest.getHeader("tranDtion"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if(!strMsg.equals(configMapper.getConfigValue("sign"))){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                return Result.error("1003","签名错误"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if(tranDtion.equals("")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //校验签名 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Map<String, Object> weChatMapSalesMsg = JSONObject.toJavaObject(msg, Map.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //签名验证 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String strSign = weChatMapSalesMsg.get("sign").toString().trim(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String merchId = weChatMapSalesMsg.get("merchId").toString().trim()==null?"":weChatMapSalesMsg.get("merchId").toString().trim(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String timestamp = weChatMapSalesMsg.get("timestamp").toString().trim()==null?"":weChatMapSalesMsg.get("timestamp").toString().trim(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String str = "JY8Te9WNt2SbMPH"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(timestamp.equals("")||merchId.equals("")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return Result.error("1002","参数错误"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Map<String, Object> weChatMapMsg = JSONObject.toJavaObject(msg, Map.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            String starTime = (String) weChatMapMsg.get("starTime"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            String endTime = (String) weChatMapMsg.get("endTime"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Integer pageIndex = Integer.parseInt(weChatMapMsg.get("pageIndex")+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Integer pageSize = Integer.parseInt(weChatMapMsg.get("pageSize")+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            weChatMapMsg.put("starTime", DateUtils.getStrDate((String) weChatMapMsg.get("starTime"))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            weChatMapMsg.put("endTime",DateUtils.getStrDate((String)weChatMapMsg.get("endTime"))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            weChatMapMsg.put("offset",pageIndex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            weChatMapMsg.put("limit",pageSize); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(!strSign.equals(checkType(weChatMapSalesMsg.get("data").toString(),timestamp,str))){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                return Result.error("1003","签名错误"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Map<String, Object> weSalesMsg =  JSONObject.toJavaObject(JSON.parseObject(weChatMapSalesMsg.get("data").toString()), Map.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String starTime = (String) weSalesMsg.get("starTime"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String endTime = (String) weSalesMsg.get("endTime"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Integer pageIndex = Integer.parseInt(weSalesMsg.get("pageIndex")+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Integer pageSize = Integer.parseInt(weSalesMsg.get("pageSize")+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            weSalesMsg.put("starTime", DateUtils.getStrDate((String) weSalesMsg.get("starTime"))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            weSalesMsg.put("endTime",DateUtils.getStrDate((String)weSalesMsg.get("endTime"))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            weSalesMsg.put("offset",pageIndex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            weSalesMsg.put("limit",pageSize); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if((pageSize-pageIndex)>500){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return Result.error("1005","请求总数或时间区间过大"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 //记录调用参数接口日志 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             long diff=(Long.parseLong(endTime) - Long.parseLong(starTime))/1000/60/60; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if(diff<=24){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                weChatMapMsg.put("tranDtion",tranDtion); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                pullQueryData(weChatMapMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                List<NewSystemFormatEntiy> list = mallMngChangeMapper.getSalesDetaiData(weChatMapMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                pullQueryData(weChatMapSalesMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                List<NewSystemFormatEntiy> list = mallMngChangeMapper.getSalesDetaiData(weSalesMsg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 //desList = DesUtils.encode(JSON.toJSONString(list)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 if(list.size()==0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     return Result.error("1004","该条件下无数据"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -105,7 +111,7 @@ public class SalesDetaiServicelImpl implements ISalesDetaiServicel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private void pullQueryData(Map msg) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Map<String,Object> map = new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        map.put("tranDirection",msg.get("tranDtion")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        map.put("tranDirection",msg.get("merchId")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         map.put("msg",msg.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         mallMngChangeMapper.pullQueryData(map); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -119,6 +125,7 @@ public class SalesDetaiServicelImpl implements ISalesDetaiServicel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public Result inserInventory(InventoryDataVo inventoryDataVo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         try{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            logger.error("插入来源于oms的库存数据"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //查询是否存在该库存信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Integer checkStuts = inventoryDataMapper.queryOneInventory(inventoryDataVo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if(checkStuts>0){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -142,25 +149,27 @@ public class SalesDetaiServicelImpl implements ISalesDetaiServicel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public Result queryInventory(JSONObject msg, HttpServletRequest httpServletRequest) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         try{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //校验签名 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Map<String, Object> weChatMapMsg = JSONObject.toJavaObject(msg, Map.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //签名验证 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            String strSign = httpServletRequest.getHeader("Sign"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            String tranDtion = httpServletRequest.getHeader("tranDtion")==null?"":httpServletRequest.getHeader("tranDtion"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            String timestamp = httpServletRequest.getHeader("timestamp")==null?"":httpServletRequest.getHeader("timestamp"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            String interType = httpServletRequest.getHeader("interType")==null?"":httpServletRequest.getHeader("interType"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if(tranDtion.equals("")||timestamp.equals("")||interType.equals("")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String strSign = weChatMapMsg.get("sign").toString().trim(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String merchId = weChatMapMsg.get("merchId").toString().trim()==null?"":weChatMapMsg.get("merchId").toString().trim(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String timestamp = weChatMapMsg.get("timestamp").toString().trim()==null?"":weChatMapMsg.get("timestamp").toString().trim(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            String str = "LYDfyGhwm1JcVlH"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(timestamp.equals("")||merchId.equals("")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return Result.error("1005","参数错误"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if(!strSign.equals(checkType(tranDtion,timestamp,interType))){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if(!strSign.equals(checkType(weChatMapMsg.get("data").toString(),timestamp,str))){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return Result.error("1003","签名错误"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            //校验签名 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Map<String, Object> weChatMapMsg = JSONObject.toJavaObject(msg, Map.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Integer pageIndex = Integer.parseInt(weChatMapMsg.get("pageIndex")+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            Integer pageSize = Integer.parseInt(weChatMapMsg.get("pageSize")+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Map<String, Object> weDtilMsg =  JSONObject.toJavaObject(JSON.parseObject(weChatMapMsg.get("data").toString()), Map.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Integer pageIndex = Integer.parseInt(weDtilMsg.get("pageIndex")+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Integer pageSize = Integer.parseInt(weDtilMsg.get("pageSize")+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             weChatMapMsg.put("offset",pageIndex); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             weChatMapMsg.put("limit",pageSize); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            weChatMapMsg.put("tranDtion",tranDtion); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            weChatMapMsg.put("interType",interType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            weChatMapMsg.put("merchId",merchId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            weChatMapMsg.put("sign",strSign); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if(pageSize>3000){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return Result.error("1004","请求数量过大"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -181,8 +190,8 @@ public class SalesDetaiServicelImpl implements ISalesDetaiServicel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //签名加密校验 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    public String checkType(String tranDtion,String timestamp,String interType) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        String sign = "tranDtion=" + tranDtion + "×tamp=" + timestamp + "&interType=" + interType; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public String checkType(String data,String timestamp,String sekey) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String sign = sekey+"data" + data + "timestamp" + timestamp; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return Md5Utils.encryption(sign); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |