Commit fbaa139e authored by mlchun's avatar mlchun

预约订单列表、预约订单详情接口

parent 7634a7a7
package io.hmit.modules.serviceOrder.controller;
import io.hmit.annotation.Login;
import io.hmit.annotation.LoginUser;
import io.hmit.common.constant.Constant;
......@@ -13,7 +12,6 @@ import io.hmit.common.validator.group.DefaultGroup;
import io.hmit.common.validator.group.UpdateGroup;
import io.hmit.entity.UserEntity;
import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
import io.hmit.modules.serviceOrder.entity.PensionOrderEntity;
import io.hmit.modules.serviceOrder.service.PensionOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
......@@ -27,7 +25,6 @@ import springfox.documentation.annotations.ApiIgnore;
import java.util.Date;
import java.util.Map;
/**
* 订单表
*
......@@ -75,7 +72,7 @@ public class PensionOrderController {
@Login
@GetMapping("incompleteOrderPage")
@ApiOperation("未完成订单分页")
@ApiOperation(value = "未完成订单分页", notes = "未完成和已接单类似,但此处返回状态为0的订单")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
......@@ -133,12 +130,36 @@ public class PensionOrderController {
return new Result<PageData<PensionOrderDTO>>().ok(page);
}
@Login
@GetMapping("noProceedOrderPage")
@ApiOperation("未接单分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
})
public Result<PageData<PensionOrderDTO>> noProceedOrderPage(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionOrderDTO> page = pensionOrderService.getNoProceedOrderPage(params);
return new Result<PageData<PensionOrderDTO>>().ok(page);
}
@Login
@GetMapping("orderInfo/{id}")
@ApiOperation("预约订单详情")
public Result<PensionOrderDTO> getOrderInfo(@ApiIgnore @LoginUser UserEntity user,
@PathVariable("id") Long id){
PensionOrderDTO data = pensionOrderService.getOrderInfoByIdAndUserId(id, user.getId());
return new Result<PensionOrderDTO>().ok(data);
}
@GetMapping("{id}")
@ApiOperation("信息")
public Result<PensionOrderDTO> get(@PathVariable("id") Long id){
PensionOrderDTO data = pensionOrderService.get(id);
return new Result<PensionOrderDTO>().ok(data);
// return new Result<PensionOrderDTO>().ok(data);
return null;
}
@PostMapping
......
......@@ -19,4 +19,9 @@ public interface PensionOrderDao extends BaseDao<PensionOrderEntity> {
IPage<PensionOrderEntity> getTodayOrderPage(IPage<PensionOrderEntity> page, Long userId);
IPage<PensionOrderEntity> getOrderPageByStatus(IPage<PensionOrderEntity> page, Long userId, Integer status);
IPage<PensionOrderEntity> getNoProceedOrderPage(IPage<PensionOrderEntity> page);
PensionOrderEntity getOrderInfoByIdAndUserId(Long orderId, Long userId);
}
\ No newline at end of file
......@@ -33,4 +33,10 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen
//查询已取消订单
PageData<PensionOrderDTO> getCanceledOrderPage(Map<String, Object> params, Long userId);
//查询未接单订单
PageData<PensionOrderDTO> getNoProceedOrderPage(Map<String, Object> params);
//查询预约订单详情
PensionOrderDTO getOrderInfoByIdAndUserId(Long id, Long userId);
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import io.hmit.common.constant.Constant;
import io.hmit.common.page.PageData;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.common.utils.ConvertUtils;
import io.hmit.modules.serviceOrder.dao.PensionOrderDao;
import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
import io.hmit.modules.serviceOrder.entity.PensionOrderEntity;
......@@ -87,4 +88,23 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
return getPageData(pensionOrderEntityIPage, PensionOrderDTO.class);
}
@Override
public PageData<PensionOrderDTO> getNoProceedOrderPage(Map<String, Object> params) {
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
IPage<PensionOrderEntity> pensionOrderEntityIPage = pensionOrderDao.getNoProceedOrderPage(page);
return getPageData(pensionOrderEntityIPage, PensionOrderDTO.class);
}
@Override
public PensionOrderDTO getOrderInfoByIdAndUserId(Long id, Long userId) {
PensionOrderEntity orderInfo = pensionOrderDao.getOrderInfoByIdAndUserId(id, userId);
orderInfo.setServiceId(null);
orderInfo.setOrderRecipientId(null);
orderInfo.setDeptId(null);
orderInfo.setCreator(null);
orderInfo.setUpdater(null);
orderInfo.setUpdateDate(null);
return ConvertUtils.sourceToTarget(orderInfo, PensionOrderDTO.class);
}
}
\ No newline at end of file
serviceOrder<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.hmit.modules.serviceOrder.dao.PensionDocumentDao">
......
......@@ -40,4 +40,12 @@
SELECT * FROM pension_order WHERE pension_order.status = #{status} and order_recipient_id = #{userId}
</select>
<select id="getNoProceedOrderPage" resultType="io.hmit.modules.serviceOrder.entity.PensionOrderEntity">
SELECT * FROM pension_order WHERE pension_order.status = 0 AND order_recipient_id IS NULL
</select>
<select id="getOrderInfoByIdAndUserId" resultType="io.hmit.modules.serviceOrder.entity.PensionOrderEntity">
SELECT * FROM pension_order WHERE pension_order.id = #{orderId} and pension_order.order_recipient_id = #{userId}
</select>
</mapper>
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