|
@@ -1,5 +1,6 @@
|
|
package com.huimv.env.produce.service.impl;
|
|
package com.huimv.env.produce.service.impl;
|
|
|
|
|
|
|
|
+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.huimv.common.utils.Result;
|
|
import com.huimv.common.utils.Result;
|
|
@@ -11,13 +12,14 @@ import com.huimv.env.produce.mapper.FeedDayMapper;
|
|
import com.huimv.env.produce.mapper.FeedMonthMapper;
|
|
import com.huimv.env.produce.mapper.FeedMonthMapper;
|
|
import com.huimv.env.produce.service.FeedDayService;
|
|
import com.huimv.env.produce.service.FeedDayService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import io.undertow.util.DateUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.text.ParseException;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -35,8 +37,6 @@ public class FeedDayServiceImpl extends ServiceImpl<FeedDayMapper, FeedDay> impl
|
|
private FeedMonthMapper feedMonthMapper;
|
|
private FeedMonthMapper feedMonthMapper;
|
|
@Autowired
|
|
@Autowired
|
|
private static final String globalFarmCode = "14";
|
|
private static final String globalFarmCode = "14";
|
|
- @Autowired
|
|
|
|
- private DateUtil dateUtil;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -110,6 +110,36 @@ public class FeedDayServiceImpl extends ServiceImpl<FeedDayMapper, FeedDay> impl
|
|
return new Result(ResultCode.SUCCESS, resultJo);
|
|
return new Result(ResultCode.SUCCESS, resultJo);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Result newFeedCount(List<FeedDay> list) {
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ QueryWrapper<FeedDay> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ queryWrapper.eq("farm_code", globalFarmCode);
|
|
|
|
+ feedDayMapper.delete(queryWrapper);
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i <list.size(); i++) {
|
|
|
|
+ FeedDay feedDay = new FeedDay();
|
|
|
|
+ feedDay.setConsumption(list.get(i).getConsumption());
|
|
|
|
+ feedDay.setAddDate(list.get(i).getAddDate());
|
|
|
|
+ feedDay.setFarmCode(globalFarmCode);
|
|
|
|
+ feedDayMapper.insert(feedDay);
|
|
|
|
+ }
|
|
|
|
+ return new Result(ResultCode.SUCCESS);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Result removeFeedCount(Map<String, String> paramSMap) {
|
|
|
|
+ String ids = paramSMap.get("ids");
|
|
|
|
+ String[] idArray = ids.split(",");
|
|
|
|
+ List<String> idList = Arrays.asList(idArray);
|
|
|
|
+ feedDayMapper.deleteBatchIds(idList);
|
|
|
|
+ return new Result(ResultCode.SUCCESS, feedDayMapper.deleteBatchIds(idList));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
private List<Object> _getFeedHistoryConsumption(Map<String, String> paramsMap) {
|
|
private List<Object> _getFeedHistoryConsumption(Map<String, String> paramsMap) {
|
|
String months = paramsMap.get("months");
|
|
String months = paramsMap.get("months");
|
|
String days = paramsMap.get("days");
|
|
String days = paramsMap.get("days");
|
|
@@ -136,4 +166,5 @@ public class FeedDayServiceImpl extends ServiceImpl<FeedDayMapper, FeedDay> impl
|
|
}
|
|
}
|
|
return consumptionList;
|
|
return consumptionList;
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|