Browse Source

碳足迹核算时间条件筛选只关注完工时间

thing_master
siyang 1 year ago
parent
commit
9371db15af
  1. 4
      modules/carbon-public/src/main/java/com/thing/carbon/pub/service/impl/CarbonPubProductionResultServiceImpl.java
  2. 4
      modules/carbon-track/src/main/java/com/thing/carbontrack/productionResult/service/impl/IotCarbonProductionResultServiceImpl.java

4
modules/carbon-public/src/main/java/com/thing/carbon/pub/service/impl/CarbonPubProductionResultServiceImpl.java

@ -5,7 +5,6 @@ import static com.thing.carbon.pub.entity.table.CarbonPubProductionResultEntityT
import static com.thing.common.core.enumeration.CarbonLifecycleEnum.*;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryColumn;
@ -494,8 +493,7 @@ public class CarbonPubProductionResultServiceImpl extends BaseServiceImpl<Carbon
if(Objects.nonNull(start) && Objects.nonNull(end)){
Date startDate = sdf.parse(start);
Date endDate = sdf.parse(end);
wrapper.and(CARBON_PUB_PRODUCTION_RESULT_ENTITY.START_TIME.between(startDate, endDate)
.or(CARBON_PUB_PRODUCTION_RESULT_ENTITY.FINISH_TIME.between(startDate, endDate)));
wrapper.between(CarbonPubProductionResultEntity::getFinishTime, startDate, endDate);
}
return list(wrapper);
}

4
modules/carbon-track/src/main/java/com/thing/carbontrack/productionResult/service/impl/IotCarbonProductionResultServiceImpl.java

@ -10,7 +10,6 @@ import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.query.QueryWrapper;
import com.thing.carbontrack.production.entity.IotCarbonProductionVarietyEntity;
import com.thing.carbontrack.production.mapper.IotCarbonProductionVarietyMapper;
import com.thing.carbontrack.production.service.IotCarbonProductionVarietyService;
import com.thing.carbontrack.productionResult.dto.*;
import com.thing.carbontrack.productionResult.entity.IotCarbonProductionResultEntity;
import com.thing.carbontrack.productionResult.mapper.IotCarbonProductionResultMapper;
@ -717,8 +716,7 @@ public class IotCarbonProductionResultServiceImpl
if(Objects.nonNull(start) && Objects.nonNull(end)){
Date startDate = sdf.parse(start);
Date endDate = sdf.parse(end);
wrapper.and(IOT_CARBON_PRODUCTION_RESULT_ENTITY.START_TIME.between(startDate, endDate)
.or(IOT_CARBON_PRODUCTION_RESULT_ENTITY.FINISH_TIME.between(startDate, endDate)));
wrapper.between(IotCarbonProductionResultEntity::getFinishTime, startDate, endDate);
}
return list(wrapper);
}

Loading…
Cancel
Save