|
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
@@ -250,14 +251,20 @@ public class BaseDuckInfoServiceImpl extends ServiceImpl<BaseDuckInfoMapper, Bas
|
|
QueryWrapper<EnvRegularCallFeeding> queryWrapper1 = new QueryWrapper<>();
|
|
QueryWrapper<EnvRegularCallFeeding> queryWrapper1 = new QueryWrapper<>();
|
|
queryWrapper1.eq("farm_id", farmId).eq("duck_num", duckNum).ge("call_date",timesmorning);
|
|
queryWrapper1.eq("farm_id", farmId).eq("duck_num", duckNum).ge("call_date",timesmorning);
|
|
List<EnvRegularCallFeeding> feedings = feedingMapper.listDay(queryWrapper1);
|
|
List<EnvRegularCallFeeding> feedings = feedingMapper.listDay(queryWrapper1);
|
|
- List<String> list = new ArrayList<>();
|
|
|
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
for (EnvRegularCallFeeding feeding : feedings) {
|
|
for (EnvRegularCallFeeding feeding : feedings) {
|
|
String s = feeding.getDuckNum() + "号鸭进食" + feeding.getDuckWeight() + "g,";
|
|
String s = feeding.getDuckNum() + "号鸭进食" + feeding.getDuckWeight() + "g,";
|
|
- list.add(s);
|
|
|
|
|
|
+ Date callDate = feeding.getCallDate();
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ String s1 = sdf.format(callDate);
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
+ jsonObject.put("time", s1);
|
|
|
|
+ jsonObject.put("info", s);
|
|
|
|
+ jsonArray.add(jsonObject);
|
|
}
|
|
}
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
jsonObject.put("duckInfo", baseDuckInfoVo);
|
|
jsonObject.put("duckInfo", baseDuckInfoVo);
|
|
- jsonObject.put("feedInfo", list);
|
|
|
|
|
|
+ jsonObject.put("feedInfo", jsonArray);
|
|
return new Result(ResultCode.SUCCESS, jsonObject);
|
|
return new Result(ResultCode.SUCCESS, jsonObject);
|
|
}
|
|
}
|
|
|
|
|