//package com.chushang.inspection.work.service;
//
//import cn.hutool.core.bean.BeanUtil;
//import cn.hutool.core.util.IdUtil;
//import com.chushang.inspection.work.dto.DispatchDTO;
//import com.chushang.inspection.work.po.WrkInfo;
//import com.chushang.inspection.work.query.DispatchQuery;
//
//import java.util.List;
//
//public interface WrkInfoDispatch {
//
//    List<WrkInfo> dispatch(DispatchQuery query, List<DispatchDTO> dispatch);
//
//    default WrkInfo construct(DispatchQuery query, DispatchDTO record, String nickName, Long userId) {
//        WrkInfo info = WrkInfo.builder().endTime(query.getEndTime() == null ? null : query.getEndTime())
//                .wrkStatus(1).workType(query.getWorkType())
//                .workNo(IdUtil.getSnowflake().nextId())
//                .remark(query.getRemark()).workSort(query.getWorkSort())
//                .userId(userId).workSource(query.getWorkSource())
//                // 业务员名称 不随着用户表名称变化而变化
//                .userName(nickName).build();
//        BeanUtil.copyProperties(record, info);
//        return info;
//    }
//}
