|
|
@@ -10,10 +10,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
-import org.springblade.core.secure.BladeUser;
|
|
|
-import org.springblade.core.secure.utils.AuthUtil;
|
|
|
-import org.springblade.core.tool.api.R;
|
|
|
-import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.modules.business.equipment.inspection.plan.dto.EquipmentInspectionPlanDTO;
|
|
|
import org.springblade.modules.business.equipment.inspection.plan.entity.EquipmentInspectionPlanEntity;
|
|
|
import org.springblade.modules.business.equipment.inspection.plan.mapper.EquipmentInspectionPlanMapper;
|
|
|
@@ -37,51 +33,56 @@ import java.util.List;
|
|
|
public class EquipmentInspectionPlanServiceImpl extends BaseServiceImpl<EquipmentInspectionPlanMapper, EquipmentInspectionPlanEntity> implements IEquipmentInspectionPlanService {
|
|
|
|
|
|
|
|
|
- @Override
|
|
|
- public IPage<EquipmentInspectionPlanVO> selectPage(IPage<EquipmentInspectionPlanVO> page, EquipmentInspectionPlanDTO inspectionInfoDTO) {
|
|
|
- return page.setRecords(baseMapper.selectPage(page, inspectionInfoDTO));
|
|
|
- }
|
|
|
+ @Override
|
|
|
+ public IPage<EquipmentInspectionPlanVO> selectPage(IPage<EquipmentInspectionPlanVO> page, EquipmentInspectionPlanDTO dto) {
|
|
|
+ return page.setRecords(baseMapper.selectPage(page, dto));
|
|
|
+ }
|
|
|
|
|
|
- @Override
|
|
|
- public EquipmentInspectionPlanEntity yearPlan() {
|
|
|
- LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
|
|
|
- wrapper.eq(EquipmentInspectionPlanEntity::getIsDeleted,0);
|
|
|
- wrapper.orderByDesc(EquipmentInspectionPlanEntity::getCreateTime);
|
|
|
- wrapper.last("limit 1");
|
|
|
- return baseMapper.selectOne(wrapper);
|
|
|
- }
|
|
|
+ @Override
|
|
|
+ public EquipmentInspectionPlanEntity yearPlan() {
|
|
|
+ LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
|
|
|
+ wrapper.eq(EquipmentInspectionPlanEntity::getIsDeleted, 0);
|
|
|
+ wrapper.orderByDesc(EquipmentInspectionPlanEntity::getCreateTime);
|
|
|
+ wrapper.last("limit 1");
|
|
|
+ return baseMapper.selectOne(wrapper);
|
|
|
+ }
|
|
|
|
|
|
- @Override
|
|
|
- public EquipmentInspectionPlanEntity getPlanInfo() {
|
|
|
- LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
|
|
|
- wrapper.eq(EquipmentInspectionPlanEntity::getIsDeleted,0);
|
|
|
- wrapper.orderByDesc(EquipmentInspectionPlanEntity::getCreateTime);
|
|
|
- List<EquipmentInspectionPlanEntity> list = this.list(wrapper);
|
|
|
- if (null != list && list.size()>0){
|
|
|
- return list.get(0);
|
|
|
- }else {
|
|
|
- EquipmentInspectionPlanEntity entity=new EquipmentInspectionPlanEntity();
|
|
|
- Calendar calendar= Calendar.getInstance();
|
|
|
- calendar.setTime(new Date());
|
|
|
- calendar.set(Calendar.MONTH,4-1);
|
|
|
- calendar.set(Calendar.DAY_OF_MONTH,1);
|
|
|
- entity.setBeforeRainSeasonStartTime(calendar.getTime());
|
|
|
- calendar.set(Calendar.MONTH,6-1);
|
|
|
- calendar.set(Calendar.DAY_OF_MONTH,1);
|
|
|
- entity.setBeforeRainSeasonEndTime(calendar.getTime());
|
|
|
- calendar.set(Calendar.MONTH,6-1);
|
|
|
- calendar.set(Calendar.DAY_OF_MONTH,1);
|
|
|
- entity.setRainSeasonFirstStartTime(calendar.getTime());
|
|
|
- calendar.set(Calendar.MONTH,8-1);
|
|
|
- calendar.set(Calendar.DAY_OF_MONTH,15);
|
|
|
- entity.setRainSeasonFirstEndTime(calendar.getTime());
|
|
|
- calendar.set(Calendar.MONTH,8-1);
|
|
|
- calendar.set(Calendar.DAY_OF_MONTH,15);
|
|
|
- entity.setRainSeasonSecondStartTime(calendar.getTime());
|
|
|
- calendar.set(Calendar.MONTH,10-1);
|
|
|
- calendar.set(Calendar.DAY_OF_MONTH,1);
|
|
|
- entity.setRainSeasonSecondEndTime(calendar.getTime());
|
|
|
- return entity;
|
|
|
- }
|
|
|
- }
|
|
|
+ @Override
|
|
|
+ public EquipmentInspectionPlanEntity getPlanInfo() {
|
|
|
+ LambdaQueryWrapper<EquipmentInspectionPlanEntity> wrapper = Wrappers.<EquipmentInspectionPlanEntity>query().lambda();
|
|
|
+ wrapper.eq(EquipmentInspectionPlanEntity::getIsDeleted, 0);
|
|
|
+ wrapper.orderByDesc(EquipmentInspectionPlanEntity::getCreateTime);
|
|
|
+ List<EquipmentInspectionPlanEntity> list = this.list(wrapper);
|
|
|
+ if (null != list && list.size() > 0) {
|
|
|
+ return list.get(0);
|
|
|
+ } else {
|
|
|
+ EquipmentInspectionPlanEntity entity = new EquipmentInspectionPlanEntity();
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTime(new Date());
|
|
|
+ calendar.set(Calendar.MONTH, 4 - 1);
|
|
|
+ calendar.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
+ entity.setBeforeRainSeasonStartTime(calendar.getTime());
|
|
|
+ calendar.set(Calendar.MONTH, 6 - 1);
|
|
|
+ calendar.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
+ entity.setBeforeRainSeasonEndTime(calendar.getTime());
|
|
|
+ calendar.set(Calendar.MONTH, 6 - 1);
|
|
|
+ calendar.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
+ entity.setRainSeasonFirstStartTime(calendar.getTime());
|
|
|
+ calendar.set(Calendar.MONTH, 8 - 1);
|
|
|
+ calendar.set(Calendar.DAY_OF_MONTH, 15);
|
|
|
+ entity.setRainSeasonFirstEndTime(calendar.getTime());
|
|
|
+ calendar.set(Calendar.MONTH, 8 - 1);
|
|
|
+ calendar.set(Calendar.DAY_OF_MONTH, 15);
|
|
|
+ entity.setRainSeasonSecondStartTime(calendar.getTime());
|
|
|
+ calendar.set(Calendar.MONTH, 10 - 1);
|
|
|
+ calendar.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
+ entity.setRainSeasonSecondEndTime(calendar.getTime());
|
|
|
+ return entity;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Long planCount(EquipmentInspectionPlanDTO dto) {
|
|
|
+ return baseMapper.planCount(dto);
|
|
|
+ }
|
|
|
}
|