Commit f8fdc546 authored by zhangch's avatar zhangch

服务计划详情回显接口调整

parent b769b9e0
......@@ -3,6 +3,7 @@ package com.hungraim.ltc.pojo.vo.governance;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 服务计划详情VO
......@@ -42,7 +43,7 @@ public class SrvTaskInfoVO implements Serializable {
/**
* 具体护理日期 yyyy-MM-dd
*/
private String[] taskDetails;
private List<String> taskDetails;
/**
* 服务计划状态
*/
......
......@@ -266,6 +266,17 @@ public class DateUtils {
}
/**
* 把date转换成yyyy-MM-dd格式的字符串
* @param date 日期对象
* @return yyyy-MM-dd字符串
*/
public static String dateToStr_yyyy_MM_dd(Date date) {
SimpleDateFormat formatter = new SimpleDateFormat(DATE_PATTERN_yyyy_MM_dd);
String dateCh = formatter.format(date);
return dateCh;
}
/**
* 将短时间格式时间转换为字符串 yyyy-MM-dd_HH_MM_ss
*
* @param dateDate
......
......@@ -127,7 +127,7 @@ public class SrvTaskController {
if (srvTaskInfoVO.getSrvEmpId() == null) {
return Result.failed("护理人员id不能为空!");
}
if (srvTaskInfoVO.getTaskDetails() == null || srvTaskInfoVO.getTaskDetails().length <= 0) {
if (srvTaskInfoVO.getTaskDetails() == null || srvTaskInfoVO.getTaskDetails().size() <= 0) {
return Result.failed("具体护理日期不能为空!");
}
List<Date> dates = new ArrayList<>();
......@@ -160,14 +160,14 @@ public class SrvTaskController {
for (int i = 0; i < taskList.size(); i++) {
String taskId = taskList.get(i).getSrvTaskId();
String srvEmpId = taskList.get(i).getSrvEmpId();
String[] taskDetails = taskList.get(i).getTaskDetails();
List<String> taskDetails = taskList.get(i).getTaskDetails();
if (StringUtils.isBlank(taskId)) {
return Result.failed("taskId不能为空!");
}
if (StringUtils.isBlank(srvEmpId)) {
return Result.failed("护理人员id不能为空!");
}
if (taskDetails == null || taskDetails.length <= 0) {
if (taskDetails == null || taskDetails.size() <= 0) {
return Result.failed("具体护理日期不能为空!");
}
List<Date> dates = new ArrayList<>();
......
......@@ -74,10 +74,10 @@ public class SrvTaskServiceImpl implements SrvTaskService {
List<String> srvDateList = new ArrayList<>();
for (ChSrvTaskDetail detail : taskDetails) {
Date srvDate = detail.getSrvDate();//服务日期
String s = DateUtils.dateToStryyyyMMdd(srvDate);
String s = DateUtils.dateToStr_yyyy_MM_dd(srvDate);
srvDateList.add(s);
}
vo.setTaskDetails(srvDateList.toArray(new String[0]));
vo.setTaskDetails(srvDateList);
}
return srvTaskInfoList;
}
......
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