|
@@ -72,7 +72,20 @@ public class FeedMonthServiceImpl extends ServiceImpl<FeedMonthMapper, FeedMonth
|
|
|
queryWrapper.eq("farm_code", globalFarmCode);
|
|
|
queryWrapper.orderByAsc("year").orderByAsc("month");
|
|
|
List<FeedMonth> feedMonthList = feedMonthMapper.selectList(queryWrapper);
|
|
|
- return new Result(ResultCode.SUCCESS,feedMonthList);
|
|
|
+ JSONArray monthJa = new JSONArray();
|
|
|
+ for(int a=0;a<feedMonthList.size();a++){
|
|
|
+ FeedMonth feedMonth = feedMonthList.get(a);
|
|
|
+ JSONObject newJo = new JSONObject();
|
|
|
+ monthJa.add(newJo);
|
|
|
+ newJo.put("consumption",feedMonth.getConsumption());
|
|
|
+ int month = feedMonth.getMonth();
|
|
|
+ String monthStr = ""+month;
|
|
|
+ if(month<10){
|
|
|
+ monthStr ="0"+monthStr;
|
|
|
+ }
|
|
|
+ newJo.put("addDate",feedMonth.getYear()+"-"+monthStr);
|
|
|
+ }
|
|
|
+ return new Result(ResultCode.SUCCESS,monthJa);
|
|
|
}
|
|
|
|
|
|
@Override
|