Sfoglia il codice sorgente

Merge branch 'master' of csk/eccs into master

Scott Chen 2 anni fa
parent
commit
9910a190a9

+ 5 - 1
eccs-biz/src/main/java/com/emato/biz/controller/mall/SalesDetailController.java

@@ -9,6 +9,8 @@ import com.emato.common.core.Result;
 import com.emato.common.core.ResultNew;
 import org.apache.http.Header;
 import org.apache.http.HttpRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -19,7 +21,7 @@ import javax.servlet.http.HttpServletRequest;
 
 @RestController
 public class SalesDetailController {
-
+    private static final Logger logger = LoggerFactory.getLogger(SalesDetailController.class);
 
     @Autowired
     private ISalesDetaiServicel salesDetaiServicel;
@@ -34,6 +36,7 @@ public class SalesDetailController {
     @PostMapping("/salesdetail/eccspushsales")
     public ResultNew pushSalesDetailServicel(@RequestBody NewSystemFormatEntiy newSystemFormatEntiy)
     {
+        logger.debug("---------- 接收销售明细推送::开始 ----------");
         return ResultNew.success(salesDetaiServicel.pushSalesDetaiServicel(newSystemFormatEntiy));
     }
 
@@ -46,6 +49,7 @@ public class SalesDetailController {
     @PostMapping("/salesdetail/getsalesdet")
     public Result getSalesDetaiData(@RequestBody JSONObject msg, HttpServletRequest httpRequest)
     {
+        logger.debug("---------- 接收商户获取销售明细::开始 ----------");
         return salesDetaiServicel.getSalesDetaiData(msg,httpRequest);
     }
 

+ 15 - 8
eccs-biz/src/main/java/com/emato/biz/service/impl/SalesDetaiServicelImpl.java

@@ -56,6 +56,7 @@ public class SalesDetaiServicelImpl implements ISalesDetaiServicel {
      */
     @Override
     public int pushSalesDetaiServicel(NewSystemFormatEntiy newSystemFormatEntiy) {
+        logger.debug("---------- 处理销售明细推送::开始写库 ----------");
         return mallMngChangeMapper.pushSalesDetaiDate(newSystemFormatEntiy);
     }
 
@@ -67,7 +68,7 @@ public class SalesDetaiServicelImpl implements ISalesDetaiServicel {
     @Override
     public Result getSalesDetaiData(JSONObject msg, HttpServletRequest httpServletRequest) {
         try {
-
+            logger.debug("---------- 处理商户获取销售明细::开始 ----------");
             //校验签名
             Map<String, Object> weChatMapSalesMsg = JSONObject.toJavaObject(msg, Map.class);
             //签名验证
@@ -121,9 +122,9 @@ public class SalesDetaiServicelImpl implements ISalesDetaiServicel {
             if(pageIndex>500){
                 return Result.error("900053","请求总数或时间区间过大");
             }
-            pageIndex = (pageIndex-1)*pageSize;
-            weSalesMsg.put("offset",pageIndex);
-            weSalesMsg.put("limit",pageSize);
+            pageIndex = (pageIndex - 1) * pageSize;
+            weSalesMsg.put("offset", pageIndex);
+            weSalesMsg.put("limit", pageSize);
                 //记录调用参数接口日志
             long diff=(Long.parseLong(endTime) - Long.parseLong(starTime))/1000/60/60;
             if(diff<=24){
@@ -137,9 +138,12 @@ public class SalesDetaiServicelImpl implements ISalesDetaiServicel {
                     Map<String,Object> map = new HashMap<>();
                     map.put("total",total);
                     map.put("rows",list);
+
+                    logger.debug("---------- 处理商户获取销售明细::结束,处理成功 ----------");
                     return Result.success(map);
                 }
             }else{
+                logger.debug("---------- 处理商户获取销售明细::结束,【900053】请求总数或时间区间过大 ----------");
                 return Result.error("900053","请求总数或时间区间过大");
             }
 
@@ -194,6 +198,7 @@ public class SalesDetaiServicelImpl implements ISalesDetaiServicel {
     @Override
     public Result queryInventory(JSONObject msg, HttpServletRequest httpServletRequest) {
         try{
+            logger.debug("---------- 处理商户获取库存数据::开始 ----------");
 
             //校验签名
             Map<String, Object> weChatMapMsg = JSONObject.toJavaObject(msg, Map.class);
@@ -243,10 +248,10 @@ public class SalesDetaiServicelImpl implements ISalesDetaiServicel {
 
             pageIndex = (pageIndex-1)*pageSize;
 
-            weChatMapMsg.put("offset",pageIndex);
-            weChatMapMsg.put("limit",pageSize);
-            weChatMapMsg.put("merchId",merchId);
-            weChatMapMsg.put("sign",strSign);
+            weChatMapMsg.put("offset", pageIndex);
+            weChatMapMsg.put("limit", pageSize);
+            weChatMapMsg.put("merchId", merchId);
+            weChatMapMsg.put("sign", strSign);
 
             String merchSn = weDtilMsg.get("merchSn").toString().trim()==null?"":weDtilMsg.get("merchSn").toString().trim();
             if(merchSn.equals("")){
@@ -268,6 +273,8 @@ public class SalesDetaiServicelImpl implements ISalesDetaiServicel {
                 map.put("total",total);
                 map.put("invTime",DateUtils.dateToStrLong(new Date()));
                 map.put("rows",list);
+
+                logger.debug("---------- 处理商户获取库存数据::结束,处理成功 ----------");
                 return Result.success(map);
             }
         }catch (Exception e){