|
@@ -1,5 +1,7 @@
|
|
package com.huimv.guowei.admin.service.impl;
|
|
package com.huimv.guowei.admin.service.impl;
|
|
|
|
|
|
|
|
+import cn.hutool.core.date.DateTime;
|
|
|
|
+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.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -23,10 +25,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
-import java.util.Calendar;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -149,7 +148,24 @@ public class EnvRegularCallEggServiceImpl extends ServiceImpl<EnvRegularCallEggM
|
|
@Override
|
|
@Override
|
|
public void printEgg(HttpServletResponse response, Map<String, String> paramsMap) throws Exception {
|
|
public void printEgg(HttpServletResponse response, Map<String, String> paramsMap) throws Exception {
|
|
String duckCode = paramsMap.get("duckCode");
|
|
String duckCode = paramsMap.get("duckCode");
|
|
- List<EnvRegularCallEggVo> envRegularCallEggVos = feedingMapper.listCount(duckCode);
|
|
|
|
|
|
+ Date duckBirthday = infoMapper.selectOne(new QueryWrapper<BaseDuckInfo>().lambda().eq(BaseDuckInfo::getDuckNum, duckCode)).getDuckBirthday();
|
|
|
|
+ DateTime dateTime = DateUtil.offsetDay(duckBirthday, 298);
|
|
|
|
+ List<EnvRegularCallEggVo> envRegularCallEggVos = new ArrayList<>();
|
|
|
|
+ int totalEgg = 0;
|
|
|
|
+ Date resultDate = null;
|
|
|
|
+ List<EnvRegularCallEgg> envRegularCallEggs = eggMapper.selectList(new QueryWrapper<EnvRegularCallEgg>().lambda()
|
|
|
|
+ .ge(EnvRegularCallEgg::getCallDate, dateTime));
|
|
|
|
+ if (ObjectUtil.isNotEmpty(envRegularCallEggs)){
|
|
|
|
+ for (EnvRegularCallEgg envRegularCallEgg : envRegularCallEggs) {
|
|
|
|
+ totalEgg += envRegularCallEgg.getEggNum();
|
|
|
|
+ if (totalEgg > 3){
|
|
|
|
+ resultDate = envRegularCallEgg.getCallDate();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (ObjectUtil.isNotEmpty(resultDate)){
|
|
|
|
+ envRegularCallEggVos = feedingMapper.listCount(duckCode,resultDate);
|
|
|
|
+ }
|
|
Print.printEgg(envRegularCallEggVos);
|
|
Print.printEgg(envRegularCallEggVos);
|
|
}
|
|
}
|
|
|
|
|