wwh 1 سال پیش
والد
کامیت
969cedbf36

+ 1 - 1
huimv-admin/src/main/java/com/huimv/guowei/admin/service/impl/BaseDuckInfoServiceImpl.java

@@ -80,7 +80,7 @@ public class BaseDuckInfoServiceImpl extends ServiceImpl<BaseDuckInfoMapper, Bas
         }
         }
         QueryWrapper<BaseDuckInfo> queryWrapper = new QueryWrapper<>();
         QueryWrapper<BaseDuckInfo> queryWrapper = new QueryWrapper<>();
         queryWrapper.like(StringUtils.isNotBlank(code), "duck_num", code)
         queryWrapper.like(StringUtils.isNotBlank(code), "duck_num", code)
-                .eq(StringUtils.isNotBlank(location), "unit_name", location).eq("farm_id", farmId).orderByDesc("duck_birthday");
+                .like(StringUtils.isNotBlank(location), "unit_name", location).eq("farm_id", farmId).orderByDesc("duck_birthday");
         Page<BaseDuckInfo> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
         Page<BaseDuckInfo> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
         return new Result(ResultCode.SUCCESS, duckInfoMapper.selectPage(page, queryWrapper));
         return new Result(ResultCode.SUCCESS, duckInfoMapper.selectPage(page, queryWrapper));
     }
     }

+ 20 - 10
huimv-admin/src/main/java/com/huimv/guowei/admin/utils/Print.java

@@ -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);
         //生成
         //生成