Commit d68e945d authored by mlchun's avatar mlchun

1.添加 老人、子女取消订单接口

parent f50ca1bd
...@@ -246,6 +246,26 @@ public class PensionOrderController { ...@@ -246,6 +246,26 @@ public class PensionOrderController {
return new Result<PageData<PensionOrderDTO>>().ok(page); return new Result<PageData<PensionOrderDTO>>().ok(page);
} }
/**
* 老人、子女取消订单
*/
@Login
@GetMapping("elderFamilyCancel")
@ApiOperation(value = "老人、子女取消订单")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "订单ID", paramType = "query", required = true, dataType="long") ,
@ApiImplicitParam(name = "cancel_reason", value = "订单取消原因", paramType = "query", dataType="String")
})
public Result elderFamilyCancel(@ApiIgnore @LoginUser UserEntity user,
@ApiIgnore @RequestParam Map<String, Object> params){
Boolean result = pensionOrderService.elderFamilyCancel(Long.parseLong(params.get("id").toString()), params.get("cancel_reason").toString());
if (!result) {
return new Result().error();
}
return new Result();
}
//新订单接口 //新订单接口
@GetMapping("{id}") @GetMapping("{id}")
......
...@@ -48,6 +48,10 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen ...@@ -48,6 +48,10 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen
//查询机构订单 //查询机构订单
PageData<PensionOrderDTO> getOrganizationOrder(Map<String, Object> params, Long userId); PageData<PensionOrderDTO> getOrganizationOrder(Map<String, Object> params, Long userId);
//机构处理订单状态
Boolean organizationHandle(Map<String, Object> params, Long userId); Boolean organizationHandle(Map<String, Object> params, Long userId);
//老人、子女取消订单
Boolean elderFamilyCancel(Long id, String reason);
} }
...@@ -201,6 +201,19 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe ...@@ -201,6 +201,19 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
return true; return true;
} }
@Override
public Boolean elderFamilyCancel(Long id, String reason) {
PensionOrderEntity pensionOrderEntity = pensionOrderDao.selectById(id);
if (null != pensionOrderEntity.getStatus() && pensionOrderEntity.getStatus() != 2 && pensionOrderEntity.getStatus() != 4) {
pensionOrderEntity.setStatus(3);
pensionOrderEntity.setStatusName(Constant.OrderStatus.CANCEL.getMessage());
pensionOrderEntity.setCancelReason(reason);
update(ConvertUtils.sourceToTarget(pensionOrderEntity, PensionOrderDTO.class));
return true;
}
return false;
}
//对List进行手动分页 //对List进行手动分页
private List<PensionOrderDTO> getSubList(Map<String, Object> params, List<PensionOrderDTO> list){ private List<PensionOrderDTO> getSubList(Map<String, Object> params, List<PensionOrderDTO> list){
Integer pageNum = Integer.parseInt(params.get("page").toString()); Integer pageNum = Integer.parseInt(params.get("page").toString());
......
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