Commit 4c218184 authored by shangtx's avatar shangtx

fix: 订单列表调整

parent 7adf4109
...@@ -70,4 +70,10 @@ public class ServiceCategoryController { ...@@ -70,4 +70,10 @@ public class ServiceCategoryController {
@CurrentUserId Long userId) { @CurrentUserId Long userId) {
return success(serviceSubclassService.saveOrUpdate(subclass, userId)); return success(serviceSubclassService.saveOrUpdate(subclass, userId));
} }
@ApiOperation(value = "获取可选小类", notes = "作者: 商天翔")
@GetMapping("/subclass-selectable")
public Result getSubClassSelectable() {
return success(serviceSubclassService.getSubClassSelectable());
}
} }
...@@ -18,6 +18,8 @@ public class OrderPageDTO extends PageParams { ...@@ -18,6 +18,8 @@ public class OrderPageDTO extends PageParams {
@ApiModelProperty("客户服务手机号") @ApiModelProperty("客户服务手机号")
private String phone; private String phone;
private String userName;
@ApiModelProperty("期望上门时间") @ApiModelProperty("期望上门时间")
private Date expectArrivalTimeBegin; private Date expectArrivalTimeBegin;
private Date expectArrivalTimeEnd; private Date expectArrivalTimeEnd;
......
package com.onsiteservice.admin.service.category; package com.onsiteservice.admin.service.category;
import com.onsiteservice.dao.common.AbstractMapper; import com.onsiteservice.dao.common.AbstractMapper;
import com.onsiteservice.dao.mapper.service.ServiceCategoryMapper;
import com.onsiteservice.dao.mapper.service.ServiceSubclassMapper;
import com.onsiteservice.dao.util.EntityUtils; import com.onsiteservice.dao.util.EntityUtils;
import com.onsiteservice.entity.category.ServiceCategory;
import com.onsiteservice.entity.category.ServiceSubclass; import com.onsiteservice.entity.category.ServiceSubclass;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collector;
import java.util.stream.Collectors;
/** /**
* @author 商天翔 * @author 商天翔
* @date 2022-07-13 17:03 * @date 2022-07-13 17:03
...@@ -15,6 +25,11 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -15,6 +25,11 @@ import org.springframework.transaction.annotation.Transactional;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public class ServiceSubclassService extends AbstractMapper<ServiceSubclass> { public class ServiceSubclassService extends AbstractMapper<ServiceSubclass> {
@Resource
private ServiceSubclassMapper serviceSubclassMapper;
@Resource
private ServiceCategoryMapper serviceCategoryMapper;
/** /**
* 保存或更新方法 * 保存或更新方法
*/ */
...@@ -29,4 +44,13 @@ public class ServiceSubclassService extends AbstractMapper<ServiceSubclass> { ...@@ -29,4 +44,13 @@ public class ServiceSubclassService extends AbstractMapper<ServiceSubclass> {
} }
public List<Map> getSubClassSelectable() {
List<ServiceCategory> categories = serviceCategoryMapper.selectAll();
Map<Integer, String> categoryMap = categories.stream().collect(Collectors.toMap(ServiceCategory::getId, ServiceCategory::getServiceName));
List<ServiceSubclass> subclassList = serviceSubclassMapper.selectAll();
return subclassList.stream().sorted(Comparator.comparing(ServiceSubclass::getCategoryId))
.map(sub -> Map.of("value", sub.getId(), "label", categoryMap.get(sub.getCategoryId()) + "-" + sub.getServiceName()))
.collect(Collectors.toList());
}
} }
...@@ -42,6 +42,9 @@ ...@@ -42,6 +42,9 @@
<if test="param.address != null"> <if test="param.address != null">
and t.address like "%"#{param.address}"%" and t.address like "%"#{param.address}"%"
</if> </if>
<if test="param.userName != null">
and t2.user_name like "%"#{param.userName}"%"
</if>
</where> </where>
order by order by
<choose> <choose>
......
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