Commit c10eb803 by 刘鑫

Merge branch 'develop' of https://gitlab.dituhui.com/bsh/project/project into develop

2 parents 6cd6bfbe 1804c3ac
...@@ -151,6 +151,12 @@ public class OrderInfoServiceImpl implements OrderInfoService { ...@@ -151,6 +151,12 @@ public class OrderInfoServiceImpl implements OrderInfoService {
if (StringUtils.isNotBlank(request.getDescription())) { if (StringUtils.isNotBlank(request.getDescription())) {
orderInfo.setDescription(request.getDescription()); orderInfo.setDescription(request.getDescription());
} }
if (BeanServiceFlowEnum.STARTED.getStatus().equals(BeanServiceFlowEnum.getStatusByName(request.getStage()))) {
orderInfo.setActualStartTime(LocalDateTimeUtil.of(request.getHappen()));
}
if (BeanServiceFlowEnum.FINISHED.getStatus().equals(BeanServiceFlowEnum.getStatusByName(request.getStage()))) {
orderInfo.setActualEndTime(LocalDateTimeUtil.of(request.getHappen()));
}
orderInfoDao.save(orderInfo); orderInfoDao.save(orderInfo);
//记录流程 //记录流程
commonService.addOrderEvent(request.getOrderId(), "", "BEAN", "BEAN", OrderStatusEnum.NORMAL.getDescription(), request.getStage(), "", LocalDateTimeUtil.of(request.getHappen())); commonService.addOrderEvent(request.getOrderId(), "", "BEAN", "BEAN", OrderStatusEnum.NORMAL.getDescription(), request.getStage(), "", LocalDateTimeUtil.of(request.getHappen()));
...@@ -336,7 +342,7 @@ public class OrderInfoServiceImpl implements OrderInfoService { ...@@ -336,7 +342,7 @@ public class OrderInfoServiceImpl implements OrderInfoService {
//处理一家多单 //处理一家多单
// order = handleMultipleOrders(order); // order = handleMultipleOrders(order);
if (!orderDt.isEqual(expectBegin.toLocalDate())){ if (!orderDt.isEqual(expectBegin.toLocalDate())) {
order = handleMultipleOrders(order); order = handleMultipleOrders(order);
} }
order.setOrgClusterId(clusterId); order.setOrgClusterId(clusterId);
......
...@@ -159,7 +159,7 @@ public class OrderServiceListServiceImpl implements OrderServiceListService { ...@@ -159,7 +159,7 @@ public class OrderServiceListServiceImpl implements OrderServiceListService {
record.setIsSpecialTime(o.getIsSpecialTime()); record.setIsSpecialTime(o.getIsSpecialTime());
record.setActualStartTime(ObjectUtil.isNull(o.getActualStartTime()) ? "" : TimeUtils.IsoTimestamp2DateTime(o.getActualStartTime())); record.setActualStartTime(ObjectUtil.isNull(o.getActualStartTime()) ? "" : TimeUtils.IsoTimestamp2DateTime(o.getActualStartTime()));
record.setActualEndTime(ObjectUtil.isNull(o.getActualStartTime()) ? "" : TimeUtils.IsoTimestamp2DateTime(o.getActualEndTime())); record.setActualEndTime(ObjectUtil.isNull(o.getActualEndTime()) ? "" : TimeUtils.IsoTimestamp2DateTime(o.getActualEndTime()));
if (StringUtils.isNotEmpty(o.getMultipleOrders())) { if (StringUtils.isNotEmpty(o.getMultipleOrders())) {
List<OrderInfoEntity> byMultipleOrders = orderInfoDao.findByMultipleOrdersAndOrderIdNot(o.getMultipleOrders(), o.getOrderId()); List<OrderInfoEntity> byMultipleOrders = orderInfoDao.findByMultipleOrdersAndOrderIdNot(o.getMultipleOrders(), o.getOrderId());
List<OrderServiceList> multipleItems = new ArrayList<>(); List<OrderServiceList> multipleItems = new ArrayList<>();
......
...@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
...@@ -33,266 +34,267 @@ import java.util.stream.Collectors; ...@@ -33,266 +34,267 @@ import java.util.stream.Collectors;
@Service @Service
public class WorkbenchServiceImpl implements WorkbenchService { public class WorkbenchServiceImpl implements WorkbenchService {
@Autowired @Autowired
private OrderEventDao orderEventDao; private OrderEventDao orderEventDao;
@Autowired @Autowired
private OrderInfoDao orderInfoDao; private OrderInfoDao orderInfoDao;
@Autowired @Autowired
private EntityManager entityManager; private EntityManager entityManager;
@Override @Override
public Result<?> getOrderChangeList(OrderChangeListDTO.Request reqDTO) { public Result<?> getOrderChangeList(OrderChangeListDTO.Request reqDTO) {
Pageable pageable = PageRequest.of(reqDTO.getPage() - 1, reqDTO.getSize()); Sort sort = Sort.by(Sort.Order.desc("createTime"));
Page<OrderEventEntity> page; Pageable pageable = PageRequest.of(reqDTO.getPage() - 1, reqDTO.getSize(), sort);
String levelType = reqDTO.getLevelType(); Page<OrderEventEntity> page;
String levelValue = reqDTO.getLevelValue(); String levelType = reqDTO.getLevelType();
Date date = DateUtil.parse(reqDTO.getDate()); String levelValue = reqDTO.getLevelValue();
if ("cluster".equals(levelType)) { Date date = DateUtil.parse(reqDTO.getDate());
page = orderEventDao.findAllByClusterId(levelValue, date, pageable); if ("cluster".equals(levelType)) {
} else if ("branch".equals(levelType)) { page = orderEventDao.findAllByClusterId(levelValue, date, pageable);
page = orderEventDao.findAllByBranchId(levelValue, date, pageable); } else if ("branch".equals(levelType)) {
} else { page = orderEventDao.findAllByBranchId(levelValue, date, pageable);
page = orderEventDao.findAllByGroupId(levelValue, date, pageable); } else {
} page = orderEventDao.findAllByGroupId(levelValue, date, pageable);
List<OrderChangeListDTO.Content> contents = new ArrayList<>(); }
for (OrderEventEntity entity : page.getContent()) { List<OrderChangeListDTO.Content> contents = new ArrayList<>();
OrderChangeListDTO.Content content = new OrderChangeListDTO.Content(); for (OrderEventEntity entity : page.getContent()) {
OrderInfoEntity orderInfoEntity = orderInfoDao.getByOrderId(entity.getOrderId()); OrderChangeListDTO.Content content = new OrderChangeListDTO.Content();
content.setOrderId(entity.getOrderId()) OrderInfoEntity orderInfoEntity = orderInfoDao.getByOrderId(entity.getOrderId());
.setCustomerName(orderInfoEntity.getName()) content.setOrderId(entity.getOrderId())
.setOperator(entity.getOperator()) .setCustomerName(orderInfoEntity.getName())
.setDescription(entity.getDescription()) .setOperator(entity.getOperator())
.setMemo(entity.getMemo()) .setDescription(entity.getDescription())
.setMemo(entity.getMemo())
.setUpdateTime(DateUtils.formatDateTime(entity.getUpdateTime())); .setUpdateTime(DateUtils.formatDateTime(entity.getUpdateTime()));
contents.add(content); contents.add(content);
} }
OrderChangeListDTO.Result rs = new OrderChangeListDTO.Result(); OrderChangeListDTO.Result rs = new OrderChangeListDTO.Result();
rs.setTotal(page.getTotalElements()) rs.setTotal(page.getTotalElements())
.setPages(page.getTotalPages()) .setPages(page.getTotalPages())
.setPageSize(page.getSize()) .setPageSize(page.getSize())
.setContent(contents); .setContent(contents);
return Result.success(rs); return Result.success(rs);
} }
@Override @Override
public Result<?> getWorkbenchSummary(String levelType, String levelValue, LocalDate dt) { public Result<?> getWorkbenchSummary(String levelType, String levelValue, LocalDate dt) {
List<WorkbenchSummaryResp.ItemDTO> items = new ArrayList<>(); List<WorkbenchSummaryResp.ItemDTO> items = new ArrayList<>();
HashMap<String, Long> methodSummary = this.transAppointmentMethod(this.queryCountByAppointmentMethod(levelType, levelValue, dt)); HashMap<String, Long> methodSummary = this.transAppointmentMethod(this.queryCountByAppointmentMethod(levelType, levelValue, dt));
WorkbenchSummaryResp.ItemDTO methodItem = new WorkbenchSummaryResp.ItemDTO(); WorkbenchSummaryResp.ItemDTO methodItem = new WorkbenchSummaryResp.ItemDTO();
methodItem.setType("order"); methodItem.setType("order");
methodItem.setRows(this.packValueAppointmentMethod(methodSummary)); methodItem.setRows(this.packValueAppointmentMethod(methodSummary));
items.add(methodItem); items.add(methodItem);
HashMap<String, Long> statusSummary = this.transOrderStatus(this.queryCountByOrderStatus(levelType, levelValue, dt)); HashMap<String, Long> statusSummary = this.transOrderStatus(this.queryCountByOrderStatus(levelType, levelValue, dt));
WorkbenchSummaryResp.ItemDTO statusItem = new WorkbenchSummaryResp.ItemDTO(); WorkbenchSummaryResp.ItemDTO statusItem = new WorkbenchSummaryResp.ItemDTO();
statusItem.setType("order"); statusItem.setType("order");
statusItem.setRows(this.packValueOrderStatus(statusSummary)); statusItem.setRows(this.packValueOrderStatus(statusSummary));
items.add(statusItem); items.add(statusItem);
WorkbenchSummaryResp res = new WorkbenchSummaryResp(); WorkbenchSummaryResp res = new WorkbenchSummaryResp();
res.setSummary(items); res.setSummary(items);
return Result.success(res); return Result.success(res);
} }
private List<Map<String, Object>> queryCountByAppointmentMethod(String levelType, String levelValue, LocalDate dt) { private List<Map<String, Object>> queryCountByAppointmentMethod(String levelType, String levelValue, LocalDate dt) {
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<Object[]> criteriaQuery = criteriaBuilder.createQuery(Object[].class); CriteriaQuery<Object[]> criteriaQuery = criteriaBuilder.createQuery(Object[].class);
Root<OrderInfoEntity> root = criteriaQuery.from(OrderInfoEntity.class); Root<OrderInfoEntity> root = criteriaQuery.from(OrderInfoEntity.class);
criteriaQuery.multiselect( criteriaQuery.multiselect(
root.get("appointmentMethod"), root.get("appointmentMethod"),
root.get("appointmentStatus"), root.get("appointmentStatus"),
criteriaBuilder.count(root).alias("count") criteriaBuilder.count(root).alias("count")
); );
Predicate datePredicate = criteriaBuilder.equal(root.get("dt"), dt); Predicate datePredicate = criteriaBuilder.equal(root.get("dt"), dt);
Predicate levelPredicate = null; Predicate levelPredicate = null;
if ("cluster".equals(levelType)) { if ("cluster".equals(levelType)) {
levelPredicate = criteriaBuilder.equal(root.get("orgClusterId"), levelValue); levelPredicate = criteriaBuilder.equal(root.get("orgClusterId"), levelValue);
} else if ("branch".equals(levelType)) { } else if ("branch".equals(levelType)) {
levelPredicate = criteriaBuilder.equal(root.get("orgBranchId"), levelValue); levelPredicate = criteriaBuilder.equal(root.get("orgBranchId"), levelValue);
} else if ("group".equals(levelType)) { } else if ("group".equals(levelType)) {
levelPredicate = criteriaBuilder.equal(root.get("orgGroupId"), levelValue); levelPredicate = criteriaBuilder.equal(root.get("orgGroupId"), levelValue);
} }
if (levelPredicate != null) { if (levelPredicate != null) {
criteriaQuery.where(datePredicate, levelPredicate); criteriaQuery.where(datePredicate, levelPredicate);
} else { } else {
criteriaQuery.where(datePredicate); criteriaQuery.where(datePredicate);
} }
criteriaQuery.groupBy(root.get("appointmentMethod"), root.get("appointmentStatus")); criteriaQuery.groupBy(root.get("appointmentMethod"), root.get("appointmentStatus"));
TypedQuery<Object[]> typedQuery = entityManager.createQuery(criteriaQuery); TypedQuery<Object[]> typedQuery = entityManager.createQuery(criteriaQuery);
List<Object[]> results = typedQuery.getResultList(); List<Object[]> results = typedQuery.getResultList();
List<Map<String, Object>> mappedResults = results.stream() List<Map<String, Object>> mappedResults = results.stream()
.map(result -> { .map(result -> {
Map<String, Object> map = Map.of( Map<String, Object> map = Map.of(
"appointmentMethod", result[0], "appointmentMethod", result[0],
"appointmentStatus", result[1], "appointmentStatus", result[1],
"count", result[2] "count", result[2]
); );
return map; return map;
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
return mappedResults; return mappedResults;
} }
public List<Map<String, Object>> queryCountByOrderStatus(String levelType, String levelValue, LocalDate dt) { public List<Map<String, Object>> queryCountByOrderStatus(String levelType, String levelValue, LocalDate dt) {
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<Object[]> criteriaQuery = criteriaBuilder.createQuery(Object[].class); CriteriaQuery<Object[]> criteriaQuery = criteriaBuilder.createQuery(Object[].class);
Root<OrderInfoEntity> root = criteriaQuery.from(OrderInfoEntity.class); Root<OrderInfoEntity> root = criteriaQuery.from(OrderInfoEntity.class);
criteriaQuery.multiselect( criteriaQuery.multiselect(
root.get("serviceStatus"), root.get("serviceStatus"),
criteriaBuilder.count(root).alias("count") criteriaBuilder.count(root).alias("count")
); );
Predicate datePredicate = criteriaBuilder.equal(root.get("dt"), dt); Predicate datePredicate = criteriaBuilder.equal(root.get("dt"), dt);
Predicate levelPredicate = null; Predicate levelPredicate = null;
if ("cluster".equals(levelType)) { if ("cluster".equals(levelType)) {
levelPredicate = criteriaBuilder.equal(root.get("orgClusterId"), levelValue); levelPredicate = criteriaBuilder.equal(root.get("orgClusterId"), levelValue);
} else if ("branch".equals(levelType)) { } else if ("branch".equals(levelType)) {
levelPredicate = criteriaBuilder.equal(root.get("orgBranchId"), levelValue); levelPredicate = criteriaBuilder.equal(root.get("orgBranchId"), levelValue);
} else if ("group".equals(levelType)) { } else if ("group".equals(levelType)) {
levelPredicate = criteriaBuilder.equal(root.get("orgGroupId"), levelValue); levelPredicate = criteriaBuilder.equal(root.get("orgGroupId"), levelValue);
} }
if (levelPredicate != null) { if (levelPredicate != null) {
criteriaQuery.where(datePredicate, levelPredicate); criteriaQuery.where(datePredicate, levelPredicate);
} else { } else {
criteriaQuery.where(datePredicate); criteriaQuery.where(datePredicate);
} }
criteriaQuery.groupBy(root.get("serviceStatus")); criteriaQuery.groupBy(root.get("serviceStatus"));
TypedQuery<Object[]> typedQuery = entityManager.createQuery(criteriaQuery); TypedQuery<Object[]> typedQuery = entityManager.createQuery(criteriaQuery);
List<Object[]> results = typedQuery.getResultList(); List<Object[]> results = typedQuery.getResultList();
List<Map<String, Object>> mappedResults = results.stream() List<Map<String, Object>> mappedResults = results.stream()
.map(result -> { .map(result -> {
Map<String, Object> map = Map.of( Map<String, Object> map = Map.of(
"serviceStatus", result[0], "serviceStatus", result[0],
"count", result[1] "count", result[1]
); );
return map; return map;
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
return mappedResults; return mappedResults;
} }
private HashMap<String, Long> transAppointmentMethod(List<Map<String, Object>> results) { private HashMap<String, Long> transAppointmentMethod(List<Map<String, Object>> results) {
HashMap<String, Long> map = new HashMap<>(); HashMap<String, Long> map = new HashMap<>();
Long manualTotal = 0L; // 人工 Long manualTotal = 0L; // 人工
Long autoTotal = 0L; Long autoTotal = 0L;
Long total = 0L; Long total = 0L;
for (Map<String, Object> result : results) { for (Map<String, Object> result : results) {
String method = (String) result.get("appointmentMethod"); String method = (String) result.get("appointmentMethod");
String status = (String) result.get("appointmentStatus"); String status = (String) result.get("appointmentStatus");
Long count = (long) result.get("count"); Long count = (long) result.get("count");
total += count; total += count;
if (method.equals("MANUAL")) { if (method.equals("MANUAL")) {
manualTotal += count; manualTotal += count;
} else if (method.startsWith("AUTO_")) { } else if (method.startsWith("AUTO_")) {
autoTotal += count; autoTotal += count;
} }
if (method.equals("MANUAL") && status.equals("INIT")) { if (method.equals("MANUAL") && status.equals("INIT")) {
map.put("manualDealing", count); map.put("manualDealing", count);
} else if (method.equals("AUTO_") && status.equals("INIT")) { } else if (method.equals("AUTO_") && status.equals("INIT")) {
map.put("autoDealing", count); map.put("autoDealing", count);
} }
} }
map.put("manualTotal", manualTotal); map.put("manualTotal", manualTotal);
map.put("autoTotal", autoTotal); map.put("autoTotal", autoTotal);
map.put("total", total); map.put("total", total);
return map; return map;
} }
private HashMap<String, Long> transOrderStatus(List<Map<String, Object>> results) { private HashMap<String, Long> transOrderStatus(List<Map<String, Object>> results) {
HashMap<String, Long> map = new HashMap<>(); HashMap<String, Long> map = new HashMap<>();
for (Map<String, Object> result : results) { for (Map<String, Object> result : results) {
String status = (String) result.get("serviceStatus"); String status = (String) result.get("serviceStatus");
Long count = (long) result.get("count"); Long count = (long) result.get("count");
map.put(status, count); map.put(status, count);
} }
return map; return map;
} }
private List<WorkbenchSummaryResp.ValueDTO> packValueAppointmentMethod(HashMap<String, Long> summary) { private List<WorkbenchSummaryResp.ValueDTO> packValueAppointmentMethod(HashMap<String, Long> summary) {
List<WorkbenchSummaryResp.ValueDTO> items = new ArrayList<>(); List<WorkbenchSummaryResp.ValueDTO> items = new ArrayList<>();
String urlName = "DispatchBenchManage"; String urlName = "DispatchBenchManage";
Long manualDealing = summary.getOrDefault("manualDealing", 0L); Long manualDealing = summary.getOrDefault("manualDealing", 0L);
Long manualTotal = summary.getOrDefault("manualTotal", 0L); Long manualTotal = summary.getOrDefault("manualTotal", 0L);
Long autoDealing = summary.getOrDefault("autoDealing", 0L); Long autoDealing = summary.getOrDefault("autoDealing", 0L);
Long autoTotal = summary.getOrDefault("autoTotal", 0L); Long autoTotal = summary.getOrDefault("autoTotal", 0L);
Long total = summary.getOrDefault("total", 0L); Long total = summary.getOrDefault("total", 0L);
HashMap<String, List<String>> p = this.packParams("appointmentStatus", OrderFlowEnum.INIT.name()); HashMap<String, List<String>> p = this.packParams("appointmentStatus", OrderFlowEnum.INIT.name());
HashMap<String, List<String>> p1 = this.packParams("appointmentType", "MANUAL"); HashMap<String, List<String>> p1 = this.packParams("appointmentType", "MANUAL");
p1.putAll(p); p1.putAll(p);
items.add(new WorkbenchSummaryResp.ValueDTO("待人工处理", manualDealing.toString(), manualTotal.toString(), "#FF8000", urlName, p1)); items.add(new WorkbenchSummaryResp.ValueDTO("待人工处理", manualDealing.toString(), manualTotal.toString(), "#FF8000", urlName, p1));
HashMap<String, List<String>> p2 = this.packParams("appointmentType", "AUTO_NOW", "AUTO_BATCH", "PROTECTION"); HashMap<String, List<String>> p2 = this.packParams("appointmentType", "AUTO_NOW", "AUTO_BATCH", "PROTECTION");
p2.putAll(p); p2.putAll(p);
items.add(new WorkbenchSummaryResp.ValueDTO("待自动处理", autoDealing.toString(), autoTotal.toString(), "#469967", urlName, p2)); items.add(new WorkbenchSummaryResp.ValueDTO("待自动处理", autoDealing.toString(), autoTotal.toString(), "#469967", urlName, p2));
items.add(new WorkbenchSummaryResp.ValueDTO("全部订单", null, total.toString(), null, urlName, new HashMap<>())); items.add(new WorkbenchSummaryResp.ValueDTO("全部订单", null, total.toString(), null, urlName, new HashMap<>()));
return items; return items;
} }
private List<WorkbenchSummaryResp.ValueDTO> packValueOrderStatus(HashMap<String, Long> summary) { private List<WorkbenchSummaryResp.ValueDTO> packValueOrderStatus(HashMap<String, Long> summary) {
List<WorkbenchSummaryResp.ValueDTO> items = new ArrayList<>(); List<WorkbenchSummaryResp.ValueDTO> items = new ArrayList<>();
String urlName = ""; // 不返回,前端就不跳转了 String urlName = ""; // 不返回,前端就不跳转了
Long assigned = summary.getOrDefault("INIT", 0L); Long assigned = summary.getOrDefault("INIT", 0L);
Long pending = summary.getOrDefault("PENDING", 0L); Long pending = summary.getOrDefault("PENDING", 0L);
Long dealing = assigned + pending; Long dealing = assigned + pending;
Long started = summary.getOrDefault("STARTED", 0L); Long started = summary.getOrDefault("STARTED", 0L);
Long finished = summary.getOrDefault("FINISHED", 0L) + summary.getOrDefault("UNFINISHED", 0L); Long finished = summary.getOrDefault("FINISHED", 0L) + summary.getOrDefault("UNFINISHED", 0L);
Long cancel = 0L; Long cancel = 0L;
HashMap<String, List<String>> p1 = this.packParams("appointmentStatus", "ASSIGNED", "CONTACTED", "DEPARTED"); HashMap<String, List<String>> p1 = this.packParams("appointmentStatus", "ASSIGNED", "CONTACTED", "DEPARTED");
items.add(new WorkbenchSummaryResp.ValueDTO("待上门", dealing.toString(), null, "#469967", urlName, p1)); items.add(new WorkbenchSummaryResp.ValueDTO("待上门", dealing.toString(), null, "#469967", urlName, p1));
HashMap<String, List<String>> p2 = this.packParams("appointmentStatus", "STARTED"); HashMap<String, List<String>> p2 = this.packParams("appointmentStatus", "STARTED");
items.add(new WorkbenchSummaryResp.ValueDTO("服务中", started.toString(), null, "#016FFF", urlName, p2)); items.add(new WorkbenchSummaryResp.ValueDTO("服务中", started.toString(), null, "#016FFF", urlName, p2));
HashMap<String, List<String>> p3 = this.packParams("appointmentStatus", "FINISHED"); HashMap<String, List<String>> p3 = this.packParams("appointmentStatus", "FINISHED");
items.add(new WorkbenchSummaryResp.ValueDTO("已完成", finished.toString(), null, null, urlName, p3)); items.add(new WorkbenchSummaryResp.ValueDTO("已完成", finished.toString(), null, null, urlName, p3));
HashMap<String, List<String>> p4 = this.packParams("appointmentStatus", "CANCELED"); HashMap<String, List<String>> p4 = this.packParams("appointmentStatus", "CANCELED");
items.add(new WorkbenchSummaryResp.ValueDTO("已取消", cancel.toString(), null, null, urlName, p4)); items.add(new WorkbenchSummaryResp.ValueDTO("已取消", cancel.toString(), null, null, urlName, p4));
HashMap<String, List<String>> p5 = this.packParams("appointmentStatus", "RESCHEDULED"); HashMap<String, List<String>> p5 = this.packParams("appointmentStatus", "RESCHEDULED");
items.add(new WorkbenchSummaryResp.ValueDTO("已改约", "0", null, null, urlName, p5)); items.add(new WorkbenchSummaryResp.ValueDTO("已改约", "0", null, null, urlName, p5));
items.add(new WorkbenchSummaryResp.ValueDTO("已延误", "0", null, "#FF3D44", urlName, new HashMap<>())); items.add(new WorkbenchSummaryResp.ValueDTO("已延误", "0", null, "#FF3D44", urlName, new HashMap<>()));
return items; return items;
} }
private <T> HashMap<String, List<T>> packParams(String key, T... values) { private <T> HashMap<String, List<T>> packParams(String key, T... values) {
HashMap<String, List<T>> map = new HashMap<>(); HashMap<String, List<T>> map = new HashMap<>();
List<T> value = new ArrayList<>(); List<T> value = new ArrayList<>();
Collections.addAll(value, values); Collections.addAll(value, values);
map.put(key, value); map.put(key, value);
return map; return map;
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!