|
@ -1,5 +1,6 @@ |
|
|
package org.dromara.demo.service.impl; |
|
|
package org.dromara.demo.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import jakarta.annotation.Resource; |
|
|
import org.dromara.common.core.utils.MapstructUtils; |
|
|
import org.dromara.common.core.utils.MapstructUtils; |
|
|
import org.dromara.common.core.utils.StringUtils; |
|
|
import org.dromara.common.core.utils.StringUtils; |
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|
@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import org.dromara.demo.domain.vo.PlanSelectVo; |
|
|
import org.dromara.demo.domain.vo.PlanSelectVo; |
|
|
|
|
|
import org.dromara.demo.service.IStationInfoService; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.dromara.demo.domain.bo.PlanInfoBo; |
|
|
import org.dromara.demo.domain.bo.PlanInfoBo; |
|
|
import org.dromara.demo.domain.vo.PlanInfoVo; |
|
|
import org.dromara.demo.domain.vo.PlanInfoVo; |
|
@ -31,6 +33,8 @@ public class PlanInfoServiceImpl implements IPlanInfoService { |
|
|
|
|
|
|
|
|
private final PlanInfoMapper baseMapper; |
|
|
private final PlanInfoMapper baseMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
private IStationInfoService stationInfoService; |
|
|
/** |
|
|
/** |
|
|
* 查询计划管理 |
|
|
* 查询计划管理 |
|
|
* |
|
|
* |
|
@ -87,12 +91,28 @@ public class PlanInfoServiceImpl implements IPlanInfoService { |
|
|
/** |
|
|
/** |
|
|
* 新增计划管理 |
|
|
* 新增计划管理 |
|
|
* |
|
|
* |
|
|
* @param bo 计划管理 |
|
|
* @param bo 管理 |
|
|
* @return 是否新增成功 |
|
|
* @return 是否新增成功 |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public Boolean insertByBo(PlanInfoBo bo) { |
|
|
public Boolean insertByBo(PlanInfoBo bo) { |
|
|
|
|
|
//List<String> ioPersonList = Arrays.asList("电信", "移动","盈力");
|
|
|
|
|
|
// TODO 计划默认值插入
|
|
|
|
|
|
String stationName = bo.getStation(); |
|
|
|
|
|
bo.setStatus("正常"); |
|
|
|
|
|
bo.setIoCompany("杭州聚光"); |
|
|
|
|
|
bo.setMonitorCompany("宁波国研"); |
|
|
|
|
|
bo.setIoPerson("吴昊"); |
|
|
|
|
|
String area = stationInfoService.getAreaByStationName(stationName); |
|
|
|
|
|
bo.setArea(area); |
|
|
|
|
|
// 模拟生成计划编号
|
|
|
|
|
|
long timeInMillis = System.currentTimeMillis(); |
|
|
|
|
|
int last6Digits = (int) (timeInMillis % 1000000); // 取后6位毫秒数
|
|
|
|
|
|
String planNum = new SimpleDateFormat("yyMMdd").format(new Date()) + |
|
|
|
|
|
String.format("%06d", last6Digits); |
|
|
|
|
|
bo.setPlanNum(planNum); |
|
|
PlanInfo add = MapstructUtils.convert(bo, PlanInfo.class); |
|
|
PlanInfo add = MapstructUtils.convert(bo, PlanInfo.class); |
|
|
|
|
|
|
|
|
validEntityBeforeSave(add); |
|
|
validEntityBeforeSave(add); |
|
|
boolean flag = baseMapper.insert(add) > 0; |
|
|
boolean flag = baseMapper.insert(add) > 0; |
|
|
if (flag) { |
|
|
if (flag) { |
|
@ -155,7 +175,7 @@ public class PlanInfoServiceImpl implements IPlanInfoService { |
|
|
String monitorType = planInfoVo.getMonitorType(); |
|
|
String monitorType = planInfoVo.getMonitorType(); |
|
|
// 需要拼接: 街道名称 (计划日期,监理类型) 得到rs
|
|
|
// 需要拼接: 街道名称 (计划日期,监理类型) 得到rs
|
|
|
String rs = String.format("%s (%s, %s)", station, formattedDate, monitorType); |
|
|
String rs = String.format("%s (%s, %s)", station, formattedDate, monitorType); |
|
|
planSelectVo.setLable(rs); |
|
|
planSelectVo.setLabel(rs); |
|
|
planSelectVo.setValue(planId); |
|
|
planSelectVo.setValue(planId); |
|
|
list.add(planSelectVo); |
|
|
list.add(planSelectVo); |
|
|
} |
|
|
} |
|
|