|
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.dromara.demo.domain.vo.PlanSelectVo; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.dromara.demo.domain.bo.PlanInfoBo; |
|
|
|
import org.dromara.demo.domain.vo.PlanInfoVo; |
|
|
@ -15,9 +16,8 @@ import org.dromara.demo.domain.PlanInfo; |
|
|
|
import org.dromara.demo.mapper.PlanInfoMapper; |
|
|
|
import org.dromara.demo.service.IPlanInfoService; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Collection; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
/** |
|
|
|
* 计划管理Service业务层处理 |
|
|
@ -80,6 +80,7 @@ public class PlanInfoServiceImpl implements IPlanInfoService { |
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getIoPerson()), PlanInfo::getIoPerson, bo.getIoPerson()); |
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getMonitorType()), PlanInfo::getMonitorType, bo.getMonitorType()); |
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getMonitorCompany()), PlanInfo::getMonitorCompany, bo.getMonitorCompany()); |
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getFlag()), PlanInfo::getFlag, bo.getFlag()); |
|
|
|
return lqw; |
|
|
|
} |
|
|
|
|
|
|
@ -134,4 +135,28 @@ public class PlanInfoServiceImpl implements IPlanInfoService { |
|
|
|
} |
|
|
|
return baseMapper.deleteByIds(ids) > 0; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<PlanSelectVo> getPlans(PlanInfoBo bo) { |
|
|
|
bo.setFlag("否"); |
|
|
|
LambdaQueryWrapper<PlanInfo> lqw = buildQueryWrapper(bo); |
|
|
|
List<PlanInfoVo> planInfoVos = baseMapper.selectVoList(lqw); |
|
|
|
List<PlanSelectVo> list = new ArrayList<>(); |
|
|
|
for (PlanInfoVo planInfoVo : planInfoVos) { |
|
|
|
PlanSelectVo planSelectVo = new PlanSelectVo(); |
|
|
|
// 街道名称
|
|
|
|
String station = planInfoVo.getStation(); |
|
|
|
// 计划日期
|
|
|
|
Date planDate = planInfoVo.getPlanDate(); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
String formattedDate = sdf.format(planDate); |
|
|
|
// 监理类型
|
|
|
|
String monitorType = planInfoVo.getMonitorType(); |
|
|
|
// 需要拼接: 街道名称 (计划日期,监理类型) 得到rs
|
|
|
|
String rs = String.format("%s (%s, %s)", station, formattedDate, monitorType); |
|
|
|
planSelectVo.setValue(rs); |
|
|
|
list.add(planSelectVo); |
|
|
|
} |
|
|
|
return list; |
|
|
|
} |
|
|
|
} |
|
|
|