Commit bedc2e60 authored by lining's avatar lining

feat: 维修工接口合并

parent 8c07daa1
......@@ -31,6 +31,6 @@ public class ServiceWorkerVO {
private String kindName;
@ApiModelProperty(value = "维修工已被指派的时间")
private List<Date> assignTime;
private List<String> assignTime;
}
......@@ -8,6 +8,7 @@ import com.onsiteservice.entity.service.ServiceWorkerAssign;
import com.onsiteservice.miniapp.controller.worker.vo.ServiceWorkerVO;
import com.onsiteservice.miniapp.mapper.service.ServiceWorkerBizMapper;
import com.onsiteservice.util.AttrCopyUtils;
import com.onsiteservice.util.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -66,7 +67,9 @@ public class ServiceWorkerService extends AbstractMapper<ServiceWorker> {
ServiceWorkerVO serviceWorkerVO = AttrCopyUtils.copy(e1, new ServiceWorkerVO());
// 维修工已经被指派的时间
List<ServiceWorkerAssign> assigns = serviceWorkerAssignMap.getOrDefault(e1.getId(), Lists.newArrayList());
List<Date> assignTimes = assigns.parallelStream().map(ServiceWorkerAssign::getAssignTime).collect(Collectors.toList());
String dateFormat = "yyyy-MM-dd HH:mm";
List<String> assignTimes = assigns.parallelStream()
.map(assign -> DateUtils.formatDate(assign.getAssignTime(), dateFormat)).collect(Collectors.toList());
serviceWorkerVO.setAssignTime(assignTimes);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment