|
@@ -94,18 +94,28 @@ public class Print {
|
|
//绑定数据
|
|
//绑定数据
|
|
Context context = new Context();
|
|
Context context = new Context();
|
|
List<EnvRegularCallEggVo> list = new ArrayList<>();
|
|
List<EnvRegularCallEggVo> list = new ArrayList<>();
|
|
- int i = 0;
|
|
|
|
for (EnvRegularCallFeeding feeding : feedings) {
|
|
for (EnvRegularCallFeeding feeding : feedings) {
|
|
- EnvRegularCallEggVo eggVo = new EnvRegularCallEggVo();
|
|
|
|
|
|
+
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
- eggVo.setDate(sdf.format(feeding.getCallDate()));
|
|
|
|
- eggVo.setDuckCode(feeding.getDuckNum());
|
|
|
|
- eggVo.setFeed(feeding.getDuckWeight());
|
|
|
|
- Integer eggNum = eggs.get(i).getEggNum();
|
|
|
|
- eggVo.setEggNum(eggNum);
|
|
|
|
- eggVo.setWeight(eggs.get(i).getDuckWeight());
|
|
|
|
- i = i+1;
|
|
|
|
- list.add(eggVo);
|
|
|
|
|
|
+ String format = sdf.format(feeding.getCallDate());
|
|
|
|
+ for (EnvRegularCallEgg egg : eggs) {
|
|
|
|
+ EnvRegularCallEggVo eggVo = new EnvRegularCallEggVo();
|
|
|
|
+ String s = sdf.format(egg.getCallDate());
|
|
|
|
+ if (s.equals(format)) {
|
|
|
|
+ eggVo.setDate(sdf.format(feeding.getCallDate()));
|
|
|
|
+ eggVo.setDuckCode(feeding.getDuckNum());
|
|
|
|
+ eggVo.setFeed(feeding.getDuckWeight());
|
|
|
|
+ eggVo.setEggNum(egg.getEggNum());
|
|
|
|
+ eggVo.setWeight(egg.getDuckWeight());
|
|
|
|
+ } else {
|
|
|
|
+ eggVo.setDate(sdf.format(feeding.getCallDate()));
|
|
|
|
+ eggVo.setDuckCode(feeding.getDuckNum());
|
|
|
|
+ eggVo.setFeed(feeding.getDuckWeight());
|
|
|
|
+ eggVo.setEggNum(0);
|
|
|
|
+ eggVo.setWeight((double) 0);
|
|
|
|
+ }
|
|
|
|
+ list.add(eggVo);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
context.putVar("list", list);
|
|
context.putVar("list", list);
|
|
//生成
|
|
//生成
|