|
@@ -49,8 +49,23 @@ public class EnvironImpl implements IEnviron {
|
|
@Override
|
|
@Override
|
|
public Result getLastEnviron(Integer farmId){
|
|
public Result getLastEnviron(Integer farmId){
|
|
Optional<EnvHourEntity> optional = envHourRepo.findLastOne(farmId);
|
|
Optional<EnvHourEntity> optional = envHourRepo.findLastOne(farmId);
|
|
|
|
+ System.out.println("optional.isPresent()>>"+optional.isPresent());
|
|
if(optional.isPresent()){
|
|
if(optional.isPresent()){
|
|
EnvHourEntity envHourEntity = optional.get();
|
|
EnvHourEntity envHourEntity = optional.get();
|
|
|
|
+ System.out.println("envHourEntity>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+envHourEntity.toString());
|
|
|
|
+ return new Result(ResultCode.SUCCESS,envHourEntity);
|
|
|
|
+// return new Result(ResultCode.SUCCESS,JSON.toJSON(envHourEntity).toString());
|
|
|
|
+ }else{
|
|
|
|
+ return new Result(Const.ERROR_CODE_NOTEXIST,Const.ERROR_MSG_NOTEXIST,false);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+// @Override
|
|
|
|
+ public Result getLastEnviron2(Integer farmId){
|
|
|
|
+ EnvHourEntity envHourEntity = envHourRepo.findLastOne2(farmId);
|
|
|
|
+ System.out.println("envHourEntity>>"+envHourEntity);
|
|
|
|
+ if(envHourEntity != null){
|
|
|
|
+ System.out.println("envHourEntity>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"+envHourEntity.toString());
|
|
return new Result(ResultCode.SUCCESS,envHourEntity);
|
|
return new Result(ResultCode.SUCCESS,envHourEntity);
|
|
// return new Result(ResultCode.SUCCESS,JSON.toJSON(envHourEntity).toString());
|
|
// return new Result(ResultCode.SUCCESS,JSON.toJSON(envHourEntity).toString());
|
|
}else{
|
|
}else{
|