浏览代码

添加应付数据接口功能。

zhuoning 3 年之前
父节点
当前提交
0e31971bbc

+ 3 - 0
huimv-hy-production/huimv.hy.erp.datasource/src/main/java/com/huimv/production/datasource/controller/ErpDataController.java

@@ -238,6 +238,9 @@ public class ErpDataController {
     public Result getCostWithManyFarm(@RequestParam(value = "year") String year,@RequestParam(value = "month") String month,@RequestParam(value = "accessToken",required = true) String accessToken){
         log.info("输入参数-->");
         log.info("month="+month);
+        if(month.trim().length()==1){
+            month="0"+month;
+        }
         String yearMonth = year+"年"+month+"月份";
         // 验证token
         Result result = tokenUtil.verifyToken(accessToken);

+ 9 - 4
huimv-hy-production/huimv.hy.erp.datasource/src/main/java/com/huimv/production/datasource/service/impl/ErpDataServiceImpl.java

@@ -371,6 +371,7 @@ public class ErpDataServiceImpl implements IErpDataService {
         System.out.println("yearMonth="+yearMonth);
         //
         List<Object[]> costList = tDeliveryRepo.getCostWithManyFarm(yearMonth);
+        System.out.println("costList.size="+costList.size());
         JSONArray costJa = new JSONArray();
         for(int a=0;a<costList.size();a++){
             Object[] costObj = (Object[]) costList.get(a);
@@ -560,10 +561,14 @@ public class ErpDataServiceImpl implements IErpDataService {
             Object[] planObj = (Object[]) payableList.get(a);
             JSONObject dataJo = new JSONObject();
             produceJa.add(dataJo);
-            //数据
-            dataJo.put("data", planObj[0]);
-            //名称
-            dataJo.put("mc", planObj[1]);
+            //排名
+            dataJo.put("rank", planObj[0]);
+            //牧场名称
+            dataJo.put("mcmc", planObj[1]);
+            //金额
+            dataJo.put("je", planObj[2]);
+            //应付单位
+            dataJo.put("supplier", planObj[3]);
         }
         return new Result(ResultCode.SUCCESS,produceJa);
     }