|
@@ -985,24 +985,39 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
// ProCountDto proCountDto = new ProCountDto();
|
|
// ProCountDto proCountDto = new ProCountDto();
|
|
queryWrapper.eq("farm_id", farmId).eq("loction_type", 1).orderByDesc("create_date").last(" limit 1");
|
|
queryWrapper.eq("farm_id", farmId).eq("loction_type", 1).orderByDesc("create_date").last(" limit 1");
|
|
ProtData protData = protDataMapper.selectOne(queryWrapper);
|
|
ProtData protData = protDataMapper.selectOne(queryWrapper);
|
|
- jsonObject.put("in", protData);
|
|
|
|
|
|
+ if (ObjectUtil.isEmpty(protData)) {
|
|
|
|
+ jsonObject.put("in", getWriteProtData() );
|
|
|
|
+ } else {
|
|
|
|
+ jsonObject.put("in", protData);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
QueryWrapper<ProtData> queryWrapper1 = new QueryWrapper<>();
|
|
QueryWrapper<ProtData> queryWrapper1 = new QueryWrapper<>();
|
|
queryWrapper1.eq("farm_id", farmId).eq("loction_type", 2).orderByDesc("create_date").last(" limit 1");
|
|
queryWrapper1.eq("farm_id", farmId).eq("loction_type", 2).orderByDesc("create_date").last(" limit 1");
|
|
ProtData protData1 = protDataMapper.selectOne(queryWrapper1);
|
|
ProtData protData1 = protDataMapper.selectOne(queryWrapper1);
|
|
- jsonObject.put("deal", protData1);
|
|
|
|
|
|
+ if (ObjectUtil.isEmpty(protData1)) {
|
|
|
|
+ jsonObject.put("deal", getWriteProtData() );
|
|
|
|
+ } else {
|
|
|
|
+ jsonObject.put("deal", protData1);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
queryWrapper2.eq("farm_id", farmId).eq("loction_type", 3).orderByDesc("create_date").last(" limit 1");
|
|
queryWrapper2.eq("farm_id", farmId).eq("loction_type", 3).orderByDesc("create_date").last(" limit 1");
|
|
ProtData protData2 = protDataMapper.selectOne(queryWrapper2);
|
|
ProtData protData2 = protDataMapper.selectOne(queryWrapper2);
|
|
- jsonObject.put("out", protData2);
|
|
|
|
|
|
+ if (ObjectUtil.isEmpty(protData2)) {
|
|
|
|
+ jsonObject.put("out", getWriteProtData() );
|
|
|
|
+ } else {
|
|
|
|
+ jsonObject.put("out", protData2);
|
|
|
|
+ }
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
QueryWrapper<WriteProtData> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<WriteProtData> queryWrapper = new QueryWrapper<>();
|
|
// ProCountDto proCountDto = new ProCountDto();
|
|
// ProCountDto proCountDto = new ProCountDto();
|
|
queryWrapper.eq("farm_id", farmId).eq("type", 1).orderByDesc("create_date").last(" limit 1");
|
|
queryWrapper.eq("farm_id", farmId).eq("type", 1).orderByDesc("create_date").last(" limit 1");
|
|
WriteProtData writeProtData = writeProtDataMapper.selectOne(queryWrapper);
|
|
WriteProtData writeProtData = writeProtDataMapper.selectOne(queryWrapper);
|
|
if (ObjectUtil.isEmpty(writeProtData)) {
|
|
if (ObjectUtil.isEmpty(writeProtData)) {
|
|
- jsonObject.put("in", new WriteProtData());
|
|
|
|
|
|
+ jsonObject.put("in", getWriteProtData() );
|
|
} else {
|
|
} else {
|
|
jsonObject.put("in", writeProtData);
|
|
jsonObject.put("in", writeProtData);
|
|
}
|
|
}
|
|
@@ -1011,7 +1026,7 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
queryWrapper1.eq("farm_id", farmId).eq("type", 2).orderByDesc("create_date").last(" limit 1");
|
|
queryWrapper1.eq("farm_id", farmId).eq("type", 2).orderByDesc("create_date").last(" limit 1");
|
|
WriteProtData writeProtData1 = writeProtDataMapper.selectOne(queryWrapper1);
|
|
WriteProtData writeProtData1 = writeProtDataMapper.selectOne(queryWrapper1);
|
|
if (ObjectUtil.isEmpty(writeProtData1)) {
|
|
if (ObjectUtil.isEmpty(writeProtData1)) {
|
|
- jsonObject.put("deal", new WriteProtData());
|
|
|
|
|
|
+ jsonObject.put("deal", getWriteProtData() );
|
|
} else {
|
|
} else {
|
|
jsonObject.put("deal", writeProtData1);
|
|
jsonObject.put("deal", writeProtData1);
|
|
}
|
|
}
|
|
@@ -1020,7 +1035,7 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
queryWrapper2.eq("farm_id", farmId).eq("type", 3).orderByDesc("create_date").last(" limit 1");
|
|
queryWrapper2.eq("farm_id", farmId).eq("type", 3).orderByDesc("create_date").last(" limit 1");
|
|
WriteProtData writeProtData2 = writeProtDataMapper.selectOne(queryWrapper2);
|
|
WriteProtData writeProtData2 = writeProtDataMapper.selectOne(queryWrapper2);
|
|
if (ObjectUtil.isEmpty(writeProtData2)) {
|
|
if (ObjectUtil.isEmpty(writeProtData2)) {
|
|
- jsonObject.put("out", new WriteProtData());
|
|
|
|
|
|
+ jsonObject.put("out",getWriteProtData() );
|
|
} else {
|
|
} else {
|
|
jsonObject.put("out", writeProtData2);
|
|
jsonObject.put("out", writeProtData2);
|
|
}
|
|
}
|
|
@@ -1030,6 +1045,10 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
return new Result(ResultCode.SUCCESS, jsonObject);
|
|
return new Result(ResultCode.SUCCESS, jsonObject);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private WriteProtData getWriteProtData() {
|
|
|
|
+ return new WriteProtData("0","0","0","0","0","0");
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public Result listScreen(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
public Result listScreen(HttpServletRequest httpServletRequest, Map<String, String> paramsMap) {
|
|
Date timesmorning = DataUill.getTimesmorning();
|
|
Date timesmorning = DataUill.getTimesmorning();
|