Commit 27c355a8 authored by mengmeng's avatar mengmeng

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	hmit-api/src/main/java/io/hmit/modules/serviceOrder/dto/PensionOrderDTO.java
#	hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/PensionOrderService.java
#	hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/impl/PensionOrderServiceImpl.java
parents cb445a4f 88afbe88
...@@ -18,7 +18,6 @@ import io.swagger.annotations.Api; ...@@ -18,7 +18,6 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
...@@ -41,7 +40,7 @@ public class PensionOrderController { ...@@ -41,7 +40,7 @@ public class PensionOrderController {
@Login @Login
@GetMapping("page") @GetMapping("page")
@ApiOperation("全部订单分页") @ApiOperation("全部订单(志愿者)")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , @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.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
...@@ -51,122 +50,61 @@ public class PensionOrderController { ...@@ -51,122 +50,61 @@ public class PensionOrderController {
public Result<PageData<PensionOrderDTO>> page(@ApiIgnore @LoginUser UserEntity user, public Result<PageData<PensionOrderDTO>> page(@ApiIgnore @LoginUser UserEntity user,
@ApiIgnore @RequestParam Map<String, Object> params){ @ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionOrderDTO> page = pensionOrderService.getAllOrderPage(params, user.getId()); PageData<PensionOrderDTO> page = pensionOrderService.getAllOrderPage(params, user.getId());
return new Result<PageData<PensionOrderDTO>>().ok(page);
}
@Login
@GetMapping("todayOrderPage")
@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>> todayOrderPage(@ApiIgnore @LoginUser UserEntity user,
@ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionOrderDTO> page = pensionOrderService.getTodayOrderPage(params, user.getId());
return new Result<PageData<PensionOrderDTO>>().ok(page);
}
@Login
@GetMapping("incompleteOrderPage")
@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") ,
@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>> incompleteOrderPage(@ApiIgnore @LoginUser UserEntity user,
@ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionOrderDTO> page = pensionOrderService.getIncompleteOrderPage(params, user.getId());
return new Result<PageData<PensionOrderDTO>>().ok(page);
}
@Login
@GetMapping("takingOrderPage")
@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>> takingOrderPage(@ApiIgnore @LoginUser UserEntity user,
@ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionOrderDTO> page = pensionOrderService.getTakingOrderPage(params, user.getId());
return new Result<PageData<PensionOrderDTO>>().ok(page); return new Result<PageData<PensionOrderDTO>>().ok(page);
} }
@Login // @Login
@GetMapping("finishedOrderPage") // @GetMapping("todayOrderPage")
@ApiOperation("已完成订单分页") // @ApiOperation("今日订单分页(未接单)")
@ApiImplicitParams({ // @ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , // @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.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , // @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") // @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
}) // })
public Result<PageData<PensionOrderDTO>> finishedOrderPage(@ApiIgnore @LoginUser UserEntity user, // public Result<PageData<PensionOrderDTO>> todayOrderPage(@ApiIgnore @LoginUser UserEntity user,
@ApiIgnore @RequestParam Map<String, Object> params){ // @ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionOrderDTO> page = pensionOrderService.getFinishedOrderPage(params, user.getId()); // PageData<PensionOrderDTO> page = pensionOrderService.getTodayOrderPage(params, user.getId());
return new Result<PageData<PensionOrderDTO>>().ok(page); //
} // return new Result<PageData<PensionOrderDTO>>().ok(page);
// }
@Login @Login
@GetMapping("canceledOrderPage") @GetMapping("getOrderPageByStatus")
@ApiOperation("已取消订单分页") @ApiOperation(value = "根据状态返回订单(带图片)", notes = "不能查看未接单订单")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , @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.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = "status", value = "订单状态: 0未接单 1已接单 2已完成 3已取消", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
}) })
public Result<PageData<PensionOrderDTO>> canceledOrderPage(@ApiIgnore @LoginUser UserEntity user, public Result<PageData<PensionOrderDTO>> getOrderPageByStatus(@ApiIgnore @LoginUser UserEntity user,
@ApiIgnore @RequestParam Map<String, Object> params){ @ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionOrderDTO> page = pensionOrderService.getCanceledOrderPage(params, user.getId()); PageData<PensionOrderDTO> page = pensionOrderService.getOrderPageByStatus(params, user.getId(), Integer.parseInt(params.get("status").toString()));
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); return new Result<PageData<PensionOrderDTO>>().ok(page);
} }
@Login @Login
@GetMapping("getOrderPageByStatus") @GetMapping("getTodayOrderPageWithCover")
@ApiOperation("根据状态返回订单") @ApiOperation("今日订单(带图片)")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , @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.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = "status", value = "状态", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") , @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
}) })
public Result<PageData<PensionOrderDTO>> getOrderPageByStatus(@ApiIgnore @LoginUser UserEntity user, public Result<PageData<PensionOrderDTO>> getTodayOrderPageByStatus(@ApiIgnore @RequestParam Map<String, Object> params){
@ApiIgnore @RequestParam Map<String, Object> params){ PageData<PensionOrderDTO> page = pensionOrderService.getTodayOrderPage(params);
PageData<PensionOrderDTO> page = pensionOrderService.getOrderPageByStatus(params, user.getId(), Integer.parseInt(params.get("status").toString()));
return new Result<PageData<PensionOrderDTO>>().ok(page); return new Result<PageData<PensionOrderDTO>>().ok(page);
} }
@Login @Login
@GetMapping("orderInfo/{id}") @GetMapping("orderInfo/{id}")
@ApiOperation("预约订单详情") @ApiOperation("预约订单详情(带图片)")
public Result<PensionOrderDTO> getOrderInfo(@ApiIgnore @LoginUser UserEntity user, public Result<PensionOrderDTO> getOrderInfo(@ApiIgnore @LoginUser UserEntity user,
@PathVariable("id") Long id){ @PathVariable("id") Long id){
PensionOrderDTO data = pensionOrderService.getOrderInfoByIdAndUserId(id, user.getId()); PensionOrderDTO data = pensionOrderService.getOrderInfoByIdAndUserIdOrStatus(id, null, null);
return new Result<PensionOrderDTO>().ok(data); return new Result<PensionOrderDTO>().ok(data);
} }
...@@ -175,14 +113,14 @@ public class PensionOrderController { ...@@ -175,14 +113,14 @@ public class PensionOrderController {
@ApiOperation("接单") @ApiOperation("接单")
public Result takingOrder(@ApiIgnore @LoginUser UserEntity user, public Result takingOrder(@ApiIgnore @LoginUser UserEntity user,
@PathVariable("id") Long id){ @PathVariable("id") Long id){
PensionOrderDTO pensionOrderDTO = pensionOrderService.getOrderInfoByIdAndStatus(id, 0); PensionOrderDTO pensionOrderDTO = pensionOrderService.getOrderInfoByIdAndStatus(id, Constant.OrderStatus.BOOKED.geStatus());
Date recipientTime = new Date(); Date recipientTime = new Date();
pensionOrderDTO.setOrderRecipientId(user.getId()); pensionOrderDTO.setOrderRecipientId(user.getId());
pensionOrderDTO.setOrderRecipientName(user.getUsername()); pensionOrderDTO.setOrderRecipientName(user.getUsername());
pensionOrderDTO.setOrderRecipientPhone(user.getMobile()); pensionOrderDTO.setOrderRecipientPhone(user.getMobile());
pensionOrderDTO.setOrderRecipientTime(recipientTime); pensionOrderDTO.setOrderRecipientTime(recipientTime);
pensionOrderDTO.setUpdateDate(recipientTime); pensionOrderDTO.setUpdateDate(recipientTime);
pensionOrderDTO.setStatus(1); //TODO 后期添加到Constant或新建枚举类 pensionOrderDTO.setStatus(Constant.OrderStatus.ORDER.geStatus());
pensionOrderDTO.setStatusName("已接单"); pensionOrderDTO.setStatusName("已接单");
pensionOrderService.update(pensionOrderDTO); pensionOrderService.update(pensionOrderDTO);
......
...@@ -2,6 +2,7 @@ package io.hmit.modules.serviceOrder.dao; ...@@ -2,6 +2,7 @@ package io.hmit.modules.serviceOrder.dao;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import io.hmit.common.dao.BaseDao; import io.hmit.common.dao.BaseDao;
import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
import io.hmit.modules.serviceOrder.entity.PensionOrderEntity; import io.hmit.modules.serviceOrder.entity.PensionOrderEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -14,18 +15,12 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -14,18 +15,12 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface PensionOrderDao extends BaseDao<PensionOrderEntity> { public interface PensionOrderDao extends BaseDao<PensionOrderEntity> {
IPage<PensionOrderEntity> getAllOrderPage(IPage<PensionOrderEntity> page, Long userId); IPage<PensionOrderDTO> getTodayNoProceedOrderPage(IPage<PensionOrderEntity> page);
IPage<PensionOrderEntity> getTodayOrderPage(IPage<PensionOrderEntity> page, Long userId); PensionOrderEntity getOrderInfoByIdAndStatus(Long orderId, Integer status);
IPage<PensionOrderEntity> getTodayNoProceedOrderPage(IPage<PensionOrderEntity> page);
IPage<PensionOrderEntity> getOrderPageByStatus(IPage<PensionOrderEntity> page, Long userId, Integer status);
IPage<PensionOrderEntity> getNoProceedOrderPage(IPage<PensionOrderEntity> page);
PensionOrderEntity getOrderInfoByIdAndUserId(Long orderId, Long userId); IPage<PensionOrderDTO> getOrderPageByStatusOrUserId(IPage<PensionOrderEntity> page, Long userId, Integer status);
PensionOrderEntity getOrderInfoByIdAndStatus(Long orderId, Integer status); PensionOrderDTO getOrderInfoByIdAndUserIdOrStatus(Long orderId, Long userId, Integer status);
} }
\ No newline at end of file
...@@ -68,6 +68,9 @@ public class PensionOrderDTO implements Serializable { ...@@ -68,6 +68,9 @@ public class PensionOrderDTO implements Serializable {
@ApiModelProperty(value = "接单人电话") @ApiModelProperty(value = "接单人电话")
private String orderRecipientPhone; private String orderRecipientPhone;
@ApiModelProperty(value = "实际金额")
private String actPrice;
@ApiModelProperty(value = "部门ID") @ApiModelProperty(value = "部门ID")
private Long deptId; private Long deptId;
...@@ -89,6 +92,9 @@ public class PensionOrderDTO implements Serializable { ...@@ -89,6 +92,9 @@ public class PensionOrderDTO implements Serializable {
@ApiModelProperty(value = "更新时间") @ApiModelProperty(value = "更新时间")
private Date updateDate; private Date updateDate;
@ApiModelProperty(value = "封面")
private String icon;
public PensionOrderDTO assemblePensionOrder(ReservationDTO reservationDTO, UserEntity user){ public PensionOrderDTO assemblePensionOrder(ReservationDTO reservationDTO, UserEntity user){
PensionOrderDTO pensionOrder = new PensionOrderDTO(); PensionOrderDTO pensionOrder = new PensionOrderDTO();
pensionOrder.setOrderNum(""); pensionOrder.setOrderNum("");
......
...@@ -75,6 +75,10 @@ public class PensionOrderEntity extends BaseEntity { ...@@ -75,6 +75,10 @@ public class PensionOrderEntity extends BaseEntity {
* 接单人电话 * 接单人电话
*/ */
private String orderRecipientPhone; private String orderRecipientPhone;
/**
* 实际金额
*/
private String actPrice;
/** /**
* 部门ID * 部门ID
*/ */
......
...@@ -22,25 +22,7 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen ...@@ -22,25 +22,7 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen
//查询今日订单 //查询今日订单
PageData<PensionOrderDTO> getTodayOrderPage(Map<String, Object> params, Long userId); PageData<PensionOrderDTO> getTodayOrderPage(Map<String, Object> params, Long userId);
//查询未完成订单 //根据订单Id和订单状态查询 (接单时使用)
PageData<PensionOrderDTO> getIncompleteOrderPage(Map<String, Object> params, Long userId);
//查询已接单订单
PageData<PensionOrderDTO> getTakingOrderPage(Map<String, Object> params, Long userId);
//查询已完成订单
PageData<PensionOrderDTO> getFinishedOrderPage(Map<String, Object> params, Long userId);
//查询已取消订单
PageData<PensionOrderDTO> getCanceledOrderPage(Map<String, Object> params, Long userId);
//查询未接单订单
PageData<PensionOrderDTO> getNoProceedOrderPage(Map<String, Object> params);
//查询预约订单详情
PensionOrderDTO getOrderInfoByIdAndUserId(Long id, Long userId);
//根据订单Id和订单状态查询
PensionOrderDTO getOrderInfoByIdAndStatus(Long orderId, Integer status); PensionOrderDTO getOrderInfoByIdAndStatus(Long orderId, Integer status);
//服务订单预约 //服务订单预约
...@@ -49,4 +31,7 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen ...@@ -49,4 +31,7 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen
//查询已完成订单 //查询已完成订单
PageData<PensionOrderDTO> getOrderPageByStatus(Map<String, Object> params, Long userId, Integer status); PageData<PensionOrderDTO> getOrderPageByStatus(Map<String, Object> params, Long userId, Integer status);
//根据用户ID或订单状态查询(带图)
PensionOrderDTO getOrderInfoByIdAndUserIdOrStatus(Long orderId, Long userId, Integer status);
} }
...@@ -28,11 +28,6 @@ import java.util.Map; ...@@ -28,11 +28,6 @@ import java.util.Map;
@Service @Service
public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, PensionOrderEntity, PensionOrderDTO> implements PensionOrderService { public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, PensionOrderEntity, PensionOrderDTO> implements PensionOrderService {
private static final Integer INCOMPLETE_ORDER = 0;
private static final Integer TAKING_ORDER = 1;
private static final Integer FINISHED_ORDER = 2;
private static final Integer CANCELED_ORDER = 3;
@Override @Override
public QueryWrapper<PensionOrderEntity> getWrapper(Map<String, Object> params){ public QueryWrapper<PensionOrderEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id"); String id = (String)params.get("id");
...@@ -49,71 +44,24 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -49,71 +44,24 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
@Autowired @Autowired
private PensionOrderServiceService pensionOrderServiceService; private PensionOrderServiceService pensionOrderServiceService;
//查询全部订单
@Override @Override
public PageData<PensionOrderDTO> getAllOrderPage(Map<String, Object> params, Long userId) { public PageData<PensionOrderDTO> getAllOrderPage(Map<String, Object> params, Long userId) {
//分页
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false); IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
IPage<PensionOrderDTO> pensionOrderEntityIPage = pensionOrderDao.getOrderPageByStatusOrUserId(page, userId, null);
//查询 -- 自定义分页
IPage<PensionOrderEntity> pensionOrderEntityIPage = pensionOrderDao.getAllOrderPage(page, userId);
return getPageData(pensionOrderEntityIPage, PensionOrderDTO.class); return getPageData(pensionOrderEntityIPage, PensionOrderDTO.class);
} }
//查询今日订单
@Override @Override
public PageData<PensionOrderDTO> getTodayOrderPage(Map<String, Object> params, Long userId) { public PageData<PensionOrderDTO> getTodayOrderPage(Map<String, Object> params) {
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false); IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
// IPage<PensionOrderEntity> pensionOrderEntityIPage = pensionOrderDao.getTodayOrderPage(page, userId); //TODO 今日订单中展示未接单订单 // IPage<PensionOrderEntity> pensionOrderEntityIPage = pensionOrderDao.getTodayOrderPage(page, userId); //TODO 今日订单中展示未接单订单
IPage<PensionOrderEntity> pensionOrderEntityIPage = pensionOrderDao.getTodayNoProceedOrderPage(page); IPage<PensionOrderDTO> pensionOrderDTOIPage = pensionOrderDao.getTodayNoProceedOrderPage(page);
return getPageData(pensionOrderEntityIPage, PensionOrderDTO.class); return getPageData(pensionOrderDTOIPage, PensionOrderDTO.class);
}
@Override
public PageData<PensionOrderDTO> getIncompleteOrderPage(Map<String, Object> params, Long userId) {
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
IPage<PensionOrderEntity> pensionOrderEntityIPage = pensionOrderDao.getOrderPageByStatus(page, userId, INCOMPLETE_ORDER);
return getPageData(pensionOrderEntityIPage, PensionOrderDTO.class);
}
@Override
public PageData<PensionOrderDTO> getTakingOrderPage(Map<String, Object> params, Long userId) {
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
IPage<PensionOrderEntity> pensionOrderEntityIPage = pensionOrderDao.getOrderPageByStatus(page, userId, TAKING_ORDER);
return getPageData(pensionOrderEntityIPage, PensionOrderDTO.class);
}
@Override
public PageData<PensionOrderDTO> getFinishedOrderPage(Map<String, Object> params, Long userId) {
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
IPage<PensionOrderEntity> pensionOrderEntityIPage = pensionOrderDao.getOrderPageByStatus(page, userId, FINISHED_ORDER);
return getPageData(pensionOrderEntityIPage, PensionOrderDTO.class);
}
@Override
public PageData<PensionOrderDTO> getCanceledOrderPage(Map<String, Object> params, Long userId) {
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
IPage<PensionOrderEntity> pensionOrderEntityIPage = pensionOrderDao.getOrderPageByStatus(page, userId, CANCELED_ORDER);
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 orderEntity = pensionOrderDao.getOrderInfoByIdAndUserId(id, userId);
orderEntity.setServiceId(null);
orderEntity.setOrderRecipientId(null);
orderEntity.setDeptId(null);
orderEntity.setCreator(null);
orderEntity.setUpdater(null);
orderEntity.setUpdateDate(null);
return ConvertUtils.sourceToTarget(orderEntity, PensionOrderDTO.class);
} }
//根据订单Id和订单状态查询 (接单时使用)
@Override @Override
public PensionOrderDTO getOrderInfoByIdAndStatus(Long id, Integer status) { public PensionOrderDTO getOrderInfoByIdAndStatus(Long id, Integer status) {
PensionOrderEntity orderEntity = pensionOrderDao.getOrderInfoByIdAndStatus(id, status); PensionOrderEntity orderEntity = pensionOrderDao.getOrderInfoByIdAndStatus(id, status);
...@@ -132,9 +80,16 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -132,9 +80,16 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
@Override @Override
public PageData<PensionOrderDTO> getOrderPageByStatus(Map<String, Object> params, Long userId, Integer status) { public PageData<PensionOrderDTO> getOrderPageByStatus(Map<String, Object> params, Long userId, Integer status) {
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false); IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
IPage<PensionOrderEntity> pensionOrderEntityIPage = pensionOrderDao.getOrderPageByStatus(page, userId, status); IPage<PensionOrderDTO> pensionOrderDTOIPage = pensionOrderDao.getOrderPageByStatusOrUserId(page, userId, status);
return getPageData(pensionOrderEntityIPage, PensionOrderDTO.class); return getPageData(pensionOrderDTOIPage, PensionOrderDTO.class);
} }
} //根据用户ID或订单状态查询(带图)
@Override
public PensionOrderDTO getOrderInfoByIdAndUserIdOrStatus(Long orderId, Long userId, Integer status) {
PensionOrderDTO pensionOrderDTO = pensionOrderDao.getOrderInfoByIdAndUserIdOrStatus(orderId, userId, status);
return pensionOrderDTO;
}
}
...@@ -28,32 +28,56 @@ ...@@ -28,32 +28,56 @@
<result property="updateDate" column="update_date"/> <result property="updateDate" column="update_date"/>
</resultMap> </resultMap>
<select id="getAllOrderPage" resultType="io.hmit.modules.serviceOrder.entity.PensionOrderEntity"> <select id="getOrderInfoByIdAndStatus" resultType="io.hmit.modules.serviceOrder.entity.PensionOrderEntity">
SELECT * FROM pension_order WHERE order_recipient_id = #{userId} SELECT * FROM pension_order WHERE pension_order.id = #{orderId} and pension_order.status = #{status}
</select>
<select id="getTodayOrderPage" resultType="io.hmit.modules.serviceOrder.entity.PensionOrderEntity">
SELECT * FROM pension_order WHERE TO_DAYS(appointment_time) = TO_DAYS(NOW()) and order_recipient_id = #{userId}
</select>
<select id="getTodayNoProceedOrderPage" resultType="io.hmit.modules.serviceOrder.entity.PensionOrderEntity">
SELECT * FROM pension_order WHERE TO_DAYS(appointment_time) = TO_DAYS(NOW()) AND pension_order.status = 0 AND order_recipient_id IS NULL
</select>
<select id="getOrderPageByStatus" resultType="io.hmit.modules.serviceOrder.entity.PensionOrderEntity">
SELECT * FROM pension_order WHERE pension_order.status = #{status} and order_recipient_id = #{userId}
</select> </select>
<select id="getNoProceedOrderPage" resultType="io.hmit.modules.serviceOrder.entity.PensionOrderEntity"> <select id="getOrderPageByStatusOrUserId" resultType="io.hmit.modules.serviceOrder.dto.PensionOrderDTO">
SELECT * FROM pension_order WHERE pension_order.status = 0 AND order_recipient_id IS NULL select po.id, po.order_num, po.status, po.status_name, po.address, po.service_id, po.service_name,
po.appointment_person, po.appointment_phone, po.appointment_time, po.remark, po.order_recipient_id,
po.order_recipient_name, po.order_recipient_phone, po.dept_id, po.creator, po.creator_name,
po.creator_tel, po.create_date, po.update_date, po.act_price, ps.icon
from pension_order po, pension_service ps
where po.service_id = ps.id
<if test="status != null and status == 0">
<if test="userId != null">
and order_recipient_id is null
</if>
and po.status = 0
</if>
<if test="status != null and status != 0">
<if test="userId != null">
and order_recipient_id = #{userId}
</if>
and po.status = #{status}
</if>
<if test="status == null and userId != null">
and order_recipient_id = #{userId}
</if>
</select> </select>
<select id="getOrderInfoByIdAndUserId" resultType="io.hmit.modules.serviceOrder.entity.PensionOrderEntity"> <select id="getOrderInfoByIdAndUserIdOrStatus" resultType="io.hmit.modules.serviceOrder.dto.PensionOrderDTO">
SELECT * FROM pension_order WHERE pension_order.id = #{orderId} and pension_order.order_recipient_id = #{userId} select po.id, po.order_num, po.status, po.status_name, po.address, po.service_id, po.service_name,
po.appointment_person, po.appointment_phone, po.appointment_time, po.remark, po.order_recipient_id,
po.order_recipient_name, po.order_recipient_phone, po.dept_id, po.creator, po.creator_name,
po.creator_tel, po.create_date, po.update_date, po.act_price, ps.icon
from pension_order po, pension_service ps
where po.service_id = ps.id and po.id = #{orderId}
<if test="userId != null">
and po.order_recipient_id = #{userId}
</if>
<if test="status != null">
and po.status = #{status}
</if>
</select> </select>
<select id="getOrderInfoByIdAndStatus" resultType="io.hmit.modules.serviceOrder.entity.PensionOrderEntity"> <select id="getTodayNoProceedOrderPage" resultType="io.hmit.modules.serviceOrder.dto.PensionOrderDTO">
SELECT * FROM pension_order WHERE pension_order.id = #{orderId} and pension_order.status = #{status} select po.id, po.order_num, po.status, po.status_name, po.address, po.service_id, po.service_name,
po.appointment_person, po.appointment_phone, po.appointment_time, po.remark, po.order_recipient_id,
po.order_recipient_name, po.order_recipient_phone, po.dept_id, po.creator, po.creator_name,
po.creator_tel, po.create_date, po.update_date, po.act_price, ps.icon
from pension_order po, pension_service ps
where po.service_id = ps.id and TO_DAYS(appointment_time) = TO_DAYS(NOW()) and po.status = 0 and order_recipient_id IS NULL
</select> </select>
</mapper> </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