|
@@ -82,8 +82,10 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
}
|
|
}
|
|
//本年
|
|
//本年
|
|
else if ("3".equals(type)) {
|
|
else if ("3".equals(type)) {
|
|
- DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
|
- queryWrapper.ge("create_date", dateTime);
|
|
|
|
|
|
+ Calendar dateTime = Calendar.getInstance();
|
|
|
|
+ int i = dateTime.get(Calendar.YEAR);
|
|
|
|
+ // DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
|
+ queryWrapper.ge("create_date",i );
|
|
queryWrapper.eq("loction_type" ,1);
|
|
queryWrapper.eq("loction_type" ,1);
|
|
List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
proCountDto.setInList(protData1);
|
|
proCountDto.setInList(protData1);
|
|
@@ -158,8 +160,10 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
}
|
|
}
|
|
//本年
|
|
//本年
|
|
else if ("3".equals(type)) {
|
|
else if ("3".equals(type)) {
|
|
- DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
|
- queryWrapper.ge("create_date", dateTime);
|
|
|
|
|
|
+ Calendar dateTime = Calendar.getInstance();
|
|
|
|
+
|
|
|
|
+ // DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
|
+ queryWrapper.ge("create_date", dateTime.get(Calendar.YEAR));
|
|
queryWrapper.eq("loction_type" ,1);
|
|
queryWrapper.eq("loction_type" ,1);
|
|
List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
proCountDto.setInList(protData1);
|
|
proCountDto.setInList(protData1);
|
|
@@ -233,8 +237,10 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
}
|
|
}
|
|
//本年
|
|
//本年
|
|
else if ("3".equals(type)) {
|
|
else if ("3".equals(type)) {
|
|
- DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
|
- queryWrapper.ge("create_date", dateTime);
|
|
|
|
|
|
+ Calendar dateTime = Calendar.getInstance();
|
|
|
|
+
|
|
|
|
+ // DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
|
+ queryWrapper.ge("create_date", dateTime.get(Calendar.YEAR));
|
|
queryWrapper.eq("loction_type" ,1);
|
|
queryWrapper.eq("loction_type" ,1);
|
|
List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
proCountDto.setInList(protData1);
|
|
proCountDto.setInList(protData1);
|
|
@@ -308,8 +314,10 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
}
|
|
}
|
|
//本年
|
|
//本年
|
|
else if ("3".equals(type)) {
|
|
else if ("3".equals(type)) {
|
|
- DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
|
- queryWrapper.ge("create_date", dateTime);
|
|
|
|
|
|
+ Calendar dateTime = Calendar.getInstance();
|
|
|
|
+
|
|
|
|
+ // DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
|
+ queryWrapper.ge("create_date", dateTime.get(Calendar.YEAR));
|
|
queryWrapper.eq("loction_type" ,1);
|
|
queryWrapper.eq("loction_type" ,1);
|
|
List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
proCountDto.setInList(protData1);
|
|
proCountDto.setInList(protData1);
|
|
@@ -383,8 +391,10 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
}
|
|
}
|
|
//本年
|
|
//本年
|
|
else if ("3".equals(type)) {
|
|
else if ("3".equals(type)) {
|
|
- DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
|
- queryWrapper.ge("create_date", dateTime);
|
|
|
|
|
|
+ Calendar dateTime = Calendar.getInstance();
|
|
|
|
+
|
|
|
|
+ // DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
|
+ queryWrapper.ge("create_date", dateTime.get(Calendar.YEAR));
|
|
queryWrapper.eq("loction_type" ,1);
|
|
queryWrapper.eq("loction_type" ,1);
|
|
List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
proCountDto.setInList(protData1);
|
|
proCountDto.setInList(protData1);
|
|
@@ -458,8 +468,10 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
}
|
|
}
|
|
//本年
|
|
//本年
|
|
else if ("3".equals(type)) {
|
|
else if ("3".equals(type)) {
|
|
- DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
|
- queryWrapper.ge("create_date", dateTime);
|
|
|
|
|
|
+ Calendar dateTime = Calendar.getInstance();
|
|
|
|
+
|
|
|
|
+ // DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
|
+ queryWrapper.ge("create_date", dateTime.get(Calendar.YEAR));
|
|
queryWrapper.eq("loction_type" ,1);
|
|
queryWrapper.eq("loction_type" ,1);
|
|
List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
proCountDto.setInList(protData1);
|
|
proCountDto.setInList(protData1);
|
|
@@ -519,7 +531,7 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
|
|
|
|
String farmId = paramsMap.get("farmId");
|
|
String farmId = paramsMap.get("farmId");
|
|
QueryWrapper<ProtWarningInfo> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<ProtWarningInfo> queryWrapper = new QueryWrapper<>();
|
|
- queryWrapper.eq("farm_id", farmId);
|
|
|
|
|
|
+ queryWrapper.eq("farm_id", farmId).orderByDesc("date").last(" limit 10");
|
|
List<ProtWarningInfo> protWarningInfos = protWarningInfoMapper.selectList(queryWrapper);
|
|
List<ProtWarningInfo> protWarningInfos = protWarningInfoMapper.selectList(queryWrapper);
|
|
//今日
|
|
//今日
|
|
Date timesmorning = DataUill.getTimesmorning();
|
|
Date timesmorning = DataUill.getTimesmorning();
|
|
@@ -561,22 +573,24 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
public Result listType(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
public Result listType(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
String farmId = paramsMap.get("farmId");
|
|
String farmId = paramsMap.get("farmId");
|
|
QueryWrapper<ProtData> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<ProtData> queryWrapper = new QueryWrapper<>();
|
|
- ProCountDto proCountDto = new ProCountDto();
|
|
|
|
-
|
|
|
|
- queryWrapper.eq("farm_id", farmId).eq("loction_type", 1);
|
|
|
|
- List<ProtData> protDataList = protDataMapper.selectList(queryWrapper);
|
|
|
|
- proCountDto.setInList(protDataList);
|
|
|
|
|
|
+ // ProCountDto proCountDto = new ProCountDto();
|
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
|
|
|
- queryWrapper.eq("farm_id", farmId).eq("loction_type", 2);
|
|
|
|
- List<ProtData> protDataList2 = protDataMapper.selectList(queryWrapper);
|
|
|
|
- proCountDto.setDealList(protDataList2);
|
|
|
|
|
|
+ queryWrapper.eq("farm_id", farmId).eq("loction_type", 1).orderByDesc("create_date").last(" limit 1");
|
|
|
|
+ ProtData protData = protDataMapper.selectOne(queryWrapper);
|
|
|
|
+ jsonObject.put("in", protData);
|
|
|
|
|
|
|
|
+ QueryWrapper<ProtData> queryWrapper1 = new QueryWrapper<>();
|
|
|
|
+ queryWrapper1.eq("farm_id", farmId).eq("loction_type", 2).orderByDesc("create_date").last(" limit 1");
|
|
|
|
+ ProtData protData1 = protDataMapper.selectOne(queryWrapper1);
|
|
|
|
+ jsonObject.put("deal", protData1);
|
|
|
|
|
|
- queryWrapper.eq("farm_id", farmId).eq("loction_type", 3);
|
|
|
|
- List<ProtData> protDataList3 = protDataMapper.selectList(queryWrapper);
|
|
|
|
- proCountDto.setOutList(protDataList3);
|
|
|
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
|
+ queryWrapper2.eq("farm_id", farmId).eq("loction_type", 3).orderByDesc("create_date").last(" limit 1");
|
|
|
|
+ ProtData protData2 = protDataMapper.selectOne(queryWrapper2);
|
|
|
|
+ jsonObject.put("out", protData2);
|
|
|
|
|
|
- return new Result(ResultCode.SUCCESS,proCountDto);
|
|
|
|
|
|
+ return new Result(ResultCode.SUCCESS,jsonObject);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|