Commit 0081eee7 authored by lings's avatar lings

Merge branch 'master' into lings

parents 6128e14e 24eb707e
package io.hmit.modules.serviceOrder.controller;
import io.hmit.common.annotation.LogOperation;
import io.hmit.common.constant.Constant;
import io.hmit.common.page.PageData;
import io.hmit.common.utils.ExcelUtils;
import io.hmit.common.utils.Result;
import io.hmit.common.validator.AssertUtils;
import io.hmit.common.validator.ValidatorUtils;
import io.hmit.common.validator.group.AddGroup;
import io.hmit.common.validator.group.DefaultGroup;
import io.hmit.common.validator.group.UpdateGroup;
import io.hmit.modules.serviceOrder.dto.PensionCommunityDTO;
import io.hmit.modules.serviceOrder.excel.PensionCommunityExcel;
import io.hmit.modules.serviceOrder.service.PensionCommunityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 社区表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-03
*/
@RestController
@RequestMapping("serviceOrder/pensioncommunity")
@Api(tags="社区表")
public class PensionCommunityController {
@Autowired
private PensionCommunityService pensionCommunityService;
@GetMapping("page")
@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")
})
@RequiresPermissions("serviceOrder:pensioncommunity:page")
public Result<PageData<PensionCommunityDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionCommunityDTO> page = pensionCommunityService.page(params);
return new Result<PageData<PensionCommunityDTO>>().ok(page);
}
@GetMapping("{id}")
@ApiOperation("信息")
@RequiresPermissions("serviceOrder:pensioncommunity:info")
public Result<PensionCommunityDTO> get(@PathVariable("id") Long id){
PensionCommunityDTO data = pensionCommunityService.get(id);
return new Result<PensionCommunityDTO>().ok(data);
}
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
@RequiresPermissions("serviceOrder:pensioncommunity:save")
public Result save(@RequestBody PensionCommunityDTO dto){
//校验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
pensionCommunityService.save(dto);
return new Result();
}
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
@RequiresPermissions("serviceOrder:pensioncommunity:update")
public Result update(@RequestBody PensionCommunityDTO dto){
//校验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
pensionCommunityService.update(dto);
return new Result();
}
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
@RequiresPermissions("serviceOrder:pensioncommunity:delete")
public Result delete(@RequestBody Long[] ids){
//校验数据
AssertUtils.isArrayEmpty(ids, "id");
pensionCommunityService.delete(ids);
return new Result();
}
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("导出")
@RequiresPermissions("serviceOrder:pensioncommunity:export")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<PensionCommunityDTO> list = pensionCommunityService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, PensionCommunityExcel.class);
}
}
\ No newline at end of file
package io.hmit.modules.serviceOrder.dao;
import io.hmit.common.dao.BaseDao;
import io.hmit.modules.serviceOrder.entity.PensionCommunityEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 社区表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-03
*/
@Mapper
public interface PensionCommunityDao extends BaseDao<PensionCommunityEntity> {
}
\ No newline at end of file
package io.hmit.modules.serviceOrder.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 社区表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-03
*/
@Data
@ApiModel(value = "社区表")
public class PensionCommunityDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private Long id;
@ApiModelProperty(value = "")
private String name;
@ApiModelProperty(value = "创建者dept_id")
private Long deptId;
@ApiModelProperty(value = "创建者")
private Long creator;
@ApiModelProperty(value = "创建时间")
private Date createDate;
@ApiModelProperty(value = "更新者")
private Long updater;
@ApiModelProperty(value = "更新时间")
private Date updateDate;
}
\ No newline at end of file
......@@ -85,5 +85,10 @@ public class PensionOrderDTO implements Serializable {
@ApiModelProperty(value = "更新时间")
private Date updateDate;
@ApiModelProperty(value = "所属社区名称")
private String communityName;
@ApiModelProperty(value = "所属社区Id")
private Long communityId;
}
......@@ -28,8 +28,11 @@ public class PensionServiceDTO implements Serializable {
@ApiModelProperty(value = "服务名称")
private String name;
@ApiModelProperty(value = "服务内容介绍")
private String serviceContent;
@ApiModelProperty(value = "服务类型")
private Long serviceTypeId;
private Long serviceParentId;
@ApiModelProperty(value = "排序")
private Integer sort;
......
......@@ -56,5 +56,22 @@ public class UserDTO implements Serializable {
@ApiModelProperty(value = "角色ID列表")
private List<Long> roleIdList;
@ApiModelProperty(value = "所属社区名称")
private String communityName;
@ApiModelProperty(value = "身体状态")
private String healthStatus;
@ApiModelProperty(value = "联系家属姓名")
private String familyMemberName;
@ApiModelProperty(value = "家属身份")
private String familyMemberRole;
@ApiModelProperty(value = "家属联系电话")
private String familyMemberTel;
@ApiModelProperty(value = "所属社区Id")
private Long communityId;
}
package io.hmit.modules.serviceOrder.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.hmit.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 社区表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-03
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("pension_community")
public class PensionCommunityEntity extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private String name;
/**
* 创建者dept_id
*/
private Long deptId;
/**
* 更新者
*/
private Long updater;
/**
* 更新时间
*/
private Date updateDate;
}
\ No newline at end of file
......@@ -59,7 +59,15 @@ public class PensionOrderEntity extends BaseEntity {
* 备注
*/
private String remark;
/**
/**
* 所属社区名称
*/
private String communityName;
/**
* 所属社区Id
*/
private Long communityId;
/**
* 接单人id
*/
private Long orderRecipientId;
......
......@@ -27,7 +27,7 @@ public class PensionServiceEntity extends BaseEntity {
/**
* 服务类型
*/
private Long serviceTypeId;
private Long serviceParentId;
/**
* 排序
*/
......@@ -72,4 +72,9 @@ public class PensionServiceEntity extends BaseEntity {
* 更新时间
*/
private Date updateDate;
/**
* 服务内容介绍
*/
private String serviceContent;
}
\ No newline at end of file
......@@ -55,4 +55,29 @@ public class UserEntity extends BaseEntity {
* 详细地址
*/
private String address;
/**
* 所属社区名称
*/
private String communityName;
/**
* 所属社区Id
*/
private Long communityId;
/**
* 身体状态
*/
private String healthStatus;
/**
* 联系家属姓名
*/
private String familyMemberName;
/**
* 家属身份
*/
private String familyMemberRole;
/**
* 家属联系电话
*/
private String familyMemberTel;
}
package io.hmit.modules.serviceOrder.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 社区表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-03
*/
@Data
public class PensionCommunityExcel {
@Excel(name = "")
private Long id;
@Excel(name = "")
private String name;
@Excel(name = "创建者dept_id")
private Long deptId;
@Excel(name = "创建者")
private Long creator;
@Excel(name = "创建时间")
private Date createDate;
@Excel(name = "更新者")
private Long updater;
@Excel(name = "更新时间")
private Date updateDate;
}
\ No newline at end of file
......@@ -33,6 +33,10 @@ public class PensionOrderExcel {
private String appointmentPhone;
@Excel(name = "预约时间")
private Date appointmentTime;
@Excel(name = "所属社区名称")
private String communityName;
@Excel(name = "所属社区Id")
private Long communityId;
@Excel(name = "备注")
private String remark;
@Excel(name = "接单人id")
......
......@@ -19,7 +19,7 @@ public class PensionServiceExcel {
@Excel(name = "服务名称")
private String name;
@Excel(name = "服务类型")
private Long serviceTypeId;
private Long serviceParentId;
@Excel(name = "排序")
private Integer sort;
@Excel(name = "首页图标地址")
......@@ -47,4 +47,7 @@ public class PensionServiceExcel {
@Excel(name = "更新时间")
private Date updateDate;
@Excel(name = "服务内容介绍")
private String serviceContent;
}
\ No newline at end of file
......@@ -33,5 +33,17 @@ public class UserExcel {
private String addressArea;
@Excel(name = "详细地址")
private String address;
@Excel(name = "所属社区名称")
private String communityName;
@Excel(name = "身体状态")
private String healthStatus;
@Excel(name = "联系家属姓名")
private String familyMemberName;
@Excel(name = "家属身份")
private String familyMemberRole;
@Excel(name = "家属联系电话")
private String familyMemberTel;
@Excel(name = "所属社区Id")
private Long communityId;
}
\ No newline at end of file
package io.hmit.modules.serviceOrder.service;
import io.hmit.common.service.CrudService;
import io.hmit.modules.serviceOrder.dto.PensionCommunityDTO;
import io.hmit.modules.serviceOrder.entity.PensionCommunityEntity;
/**
* 社区表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-03
*/
public interface PensionCommunityService extends CrudService<PensionCommunityEntity, PensionCommunityDTO> {
}
\ No newline at end of file
package io.hmit.modules.serviceOrder.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.modules.serviceOrder.dao.PensionCommunityDao;
import io.hmit.modules.serviceOrder.dto.PensionCommunityDTO;
import io.hmit.modules.serviceOrder.entity.PensionCommunityEntity;
import io.hmit.modules.serviceOrder.service.PensionCommunityService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* 社区表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-03
*/
@Service
public class PensionCommunityServiceImpl extends CrudServiceImpl<PensionCommunityDao, PensionCommunityEntity, PensionCommunityDTO> implements PensionCommunityService {
@Override
public QueryWrapper<PensionCommunityEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
QueryWrapper<PensionCommunityEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
return wrapper;
}
}
\ No newline at end of file
<?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.PensionCommunityDao">
<resultMap type="io.hmit.modules.serviceOrder.entity.PensionCommunityEntity" id="pensionCommunityMap">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="deptId" column="dept_id"/>
<result property="creator" column="creator"/>
<result property="createDate" column="create_date"/>
<result property="updater" column="updater"/>
<result property="updateDate" column="update_date"/>
</resultMap>
</mapper>
\ No newline at end of file
......@@ -43,5 +43,19 @@ public class UserInfoDTO {
@ApiModelProperty(value = "详细地址")
private String address;
@ApiModelProperty(value = "所属社区名称")
private String communityName;
@ApiModelProperty(value = "身体状态")
private String healthStatus;
@ApiModelProperty(value = "联系家属姓名")
private String familyMemberName;
@ApiModelProperty(value = "家属身份")
private String familyMemberRole;
@ApiModelProperty(value = "家属联系电话")
private String familyMemberTel;
}
......@@ -62,5 +62,29 @@ public class UserEntity implements Serializable {
* 详细地址
*/
private String address;
/**
* 所属社区名称
*/
private String communityName;
/**
* 身体状态
*/
private String healthStatus;
/**
* 联系家属姓名
*/
private String familyMemberName;
/**
* 家属身份
*/
private String familyMemberRole;
/**
* 家属联系电话
*/
private String familyMemberTel;
/**
* 所属社区Id
*/
private Long communityId;
}
package io.hmit.modules.serviceOrder.controller;
import io.hmit.common.constant.Constant;
import io.hmit.common.page.PageData;
import io.hmit.common.utils.Result;
import io.hmit.common.validator.AssertUtils;
import io.hmit.common.validator.ValidatorUtils;
import io.hmit.common.validator.group.AddGroup;
import io.hmit.common.validator.group.DefaultGroup;
import io.hmit.common.validator.group.UpdateGroup;
import io.hmit.modules.serviceOrder.dto.PensionCommunityDTO;
import io.hmit.modules.serviceOrder.service.PensionCommunityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 社区表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-03
*/
@RestController
@RequestMapping("serviceOrder/pensioncommunity")
@Api(tags="社区表")
public class PensionCommunityController {
@Autowired
private PensionCommunityService pensionCommunityService;
@GetMapping("page")
@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<PensionCommunityDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionCommunityDTO> page = pensionCommunityService.page(params);
return new Result<PageData<PensionCommunityDTO>>().ok(page);
}
@GetMapping("{id}")
@ApiOperation("信息")
public Result<PensionCommunityDTO> get(@PathVariable("id") Long id){
PensionCommunityDTO data = pensionCommunityService.get(id);
return new Result<PensionCommunityDTO>().ok(data);
}
@PostMapping
@ApiOperation("保存")
public Result save(@RequestBody PensionCommunityDTO dto){
//校验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
pensionCommunityService.save(dto);
return new Result();
}
@PutMapping
@ApiOperation("修改")
public Result update(@RequestBody PensionCommunityDTO dto){
//校验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
pensionCommunityService.update(dto);
return new Result();
}
@DeleteMapping
@ApiOperation("删除")
public Result delete(@RequestBody Long[] ids){
//校验数据
AssertUtils.isArrayEmpty(ids, "id");
pensionCommunityService.delete(ids);
return new Result();
}
}
\ No newline at end of file
......@@ -18,6 +18,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
......@@ -53,25 +54,29 @@ public class PensionOrderController {
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("getElderAllOrderOrByStatusList")
@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 = "status", value = "订单状态: 0未接单 1已接单 2已完成 3已取消", paramType = "query", 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>> getElderAllOrderOrByStatusList(@ApiIgnore @LoginUser UserEntity creator,
@ApiIgnore @RequestParam Map<String, Object> params){
Integer status = null;
if (null != params.get("status")) {
status = Integer.parseInt(params.get("status").toString());
}
PageData<PensionOrderDTO> page = pensionOrderService.getElderAllOrderOrByStatusPage(params, creator.getId(), status);
return new Result<PageData<PensionOrderDTO>>().ok(page);
}
@Login
@GetMapping("getOrderPageByStatus")
@ApiOperation(value = "根据状态返回订单(带图片)", notes = "不能查看未接单订单")
@ApiOperation(value = "根据状态返回订单(志愿者)", notes = "不能查看未接单订单")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
......@@ -87,7 +92,7 @@ public class PensionOrderController {
@Login
@GetMapping("getTodayOrderPageWithCover")
@ApiOperation("今日订单(带图片)")
@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") ,
......@@ -100,25 +105,24 @@ public class PensionOrderController {
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("getElderTodayOrderPage")
@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>> getElderTodayOrderPage(@ApiIgnore @LoginUser UserEntity creator,
@ApiIgnore @RequestParam Map<String, Object> params){
PageData<PensionOrderDTO> page = pensionOrderService.getElderTodayOrderPage(params, creator.getId());
return new Result<PageData<PensionOrderDTO>>().ok(page);
}
@Login
@GetMapping("orderInfo/{id}")
@ApiOperation("预约订单详情(带图片)")
@ApiOperation("预约订单详情(志愿者)")
public Result<PensionOrderDTO> getOrderInfo(@ApiIgnore @LoginUser UserEntity user,
@PathVariable("id") Long id){
PensionOrderDTO data = pensionOrderService.getOrderInfoByIdAndUserIdOrStatus(id, null, null);
......@@ -127,7 +131,7 @@ public class PensionOrderController {
@Login
@PutMapping("takingOrder/{id}")
@ApiOperation("接单")
@ApiOperation("接单(志愿者)")
public Result takingOrder(@ApiIgnore @LoginUser UserEntity user,
@PathVariable("id") Long id){
PensionOrderDTO pensionOrderDTO = pensionOrderService.getOrderInfoByIdAndStatus(id, Constant.OrderStatus.BOOKED.geStatus());
......
......@@ -71,7 +71,7 @@ public class PensionServiceController {
public Result<PensionServiceDTO> getByServiceTypeId(@PathVariable("serviceTypeId") Long serviceTypeId){
List<PensionServiceDTO> data = baseMapper.selectList(
new QueryWrapper<PensionServiceDTO>().lambda()
.eq(PensionServiceDTO::getServiceTypeId,serviceTypeId));
.eq(PensionServiceDTO::getServiceParentId,serviceTypeId));
return new Result<PensionServiceDTO>().ok(data.get(0));
}
......
package io.hmit.modules.serviceOrder.dao;
import io.hmit.common.dao.BaseDao;
import io.hmit.modules.serviceOrder.entity.PensionCommunityEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 社区表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-03
*/
@Mapper
public interface PensionCommunityDao extends BaseDao<PensionCommunityEntity> {
}
\ No newline at end of file
......@@ -2,10 +2,14 @@ package io.hmit.modules.serviceOrder.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.hmit.common.dao.BaseDao;
import io.hmit.common.page.PageData;
import io.hmit.modules.serviceOrder.dto.PensionOrderDTO;
import io.hmit.modules.serviceOrder.entity.PensionOrderEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 订单表
*
......@@ -15,6 +19,11 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface PensionOrderDao extends BaseDao<PensionOrderEntity> {
/**
* 志愿者:今日订单接单接口
* @param page
* @return
*/
IPage<PensionOrderDTO> getTodayNoProceedOrderPage(IPage<PensionOrderEntity> page);
PensionOrderEntity getOrderInfoByIdAndStatus(Long orderId, Integer status);
......@@ -23,4 +32,21 @@ public interface PensionOrderDao extends BaseDao<PensionOrderEntity> {
PensionOrderDTO getOrderInfoByIdAndUserIdOrStatus(Long orderId, Long userId, Integer status);
/**
* 老人:今日订单
* @param page
* @param creator
* @return
*/
IPage<PensionOrderDTO> getElderTodayOrderPage(IPage<PensionOrderEntity> page, Long creator);
/**
* 老人:全部订单
* @param params
* @param creator
* @return
*/
List<PensionOrderDTO> getElderAllOrderOrByStatusList(Map<String, Object> params, Long creator, Integer status);
}
package io.hmit.modules.serviceOrder.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 社区表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-03
*/
@Data
@ApiModel(value = "社区表")
public class PensionCommunityDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
private Long id;
@ApiModelProperty(value = "")
private String name;
@ApiModelProperty(value = "创建者dept_id")
private Long deptId;
@ApiModelProperty(value = "创建者")
private Long creator;
@ApiModelProperty(value = "创建时间")
private Date createDate;
@ApiModelProperty(value = "更新者")
private Long updater;
@ApiModelProperty(value = "更新时间")
private Date updateDate;
}
\ No newline at end of file
......@@ -94,6 +94,12 @@ public class PensionOrderDTO implements Serializable {
@ApiModelProperty(value = "封面")
private String icon;
@ApiModelProperty(value = "所属社区名称")
private String communityName;
@ApiModelProperty(value = "所属社区Id")
private Long communityId;
public PensionOrderDTO assemblePensionOrder(ReservationDTO reservationDTO, UserEntity user){
PensionOrderDTO pensionOrder = new PensionOrderDTO();
pensionOrder.setOrderNum("");
......
......@@ -25,8 +25,11 @@ public class PensionServiceDTO implements Serializable {
@ApiModelProperty(value = "服务名称")
private String serviceName;
@ApiModelProperty(value = "服务内容介绍")
private String serviceContent;
@ApiModelProperty(value = "服务类型")
private Long serviceTypeId;
private Long serviceParentId;
@ApiModelProperty(value = "排序")
private Integer sort;
......
package io.hmit.modules.serviceOrder.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.hmit.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 社区表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-03
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("pension_community")
public class PensionCommunityEntity extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private String name;
/**
* 创建者dept_id
*/
private Long deptId;
/**
* 更新者
*/
private Long updater;
/**
* 更新时间
*/
private Date updateDate;
}
\ No newline at end of file
......@@ -99,4 +99,14 @@ public class PensionOrderEntity extends BaseEntity {
* 更新时间
*/
private Date updateDate;
/**
* 所属社区名称
*/
private String communityName;
/**
* 所属社区Id
*/
private Long communityId;
}
......@@ -27,9 +27,9 @@ public class PensionServiceEntity extends BaseEntity {
// @Property(value = "name")
private String serviceName;
/**
* 服务类型
* 服务父类ID
*/
private Long serviceTypeId;
private Long serviceParentId;
/**
* 排序
*/
......@@ -78,4 +78,9 @@ public class PensionServiceEntity extends BaseEntity {
* 更新时间
*/
private Date updateDate;
/**
* 服务内容介绍
*/
private String serviceContent;
}
package io.hmit.modules.serviceOrder.service;
import io.hmit.common.service.CrudService;
import io.hmit.modules.serviceOrder.dto.PensionCommunityDTO;
import io.hmit.modules.serviceOrder.entity.PensionCommunityEntity;
/**
* 社区表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-03
*/
public interface PensionCommunityService extends CrudService<PensionCommunityEntity, PensionCommunityDTO> {
}
\ No newline at end of file
......@@ -33,4 +33,10 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen
//根据用户ID或订单状态查询(带图)
PensionOrderDTO getOrderInfoByIdAndUserIdOrStatus(Long orderId, Long userId, Integer status);
//老人今日订单
PageData<PensionOrderDTO> getElderTodayOrderPage(Map<String, Object> params, Long creator);
//老人全部订单或根据订单状态查询
PageData<PensionOrderDTO> getElderAllOrderOrByStatusPage(Map<String, Object> params, Long creator, Integer status);
}
package io.hmit.modules.serviceOrder.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.hmit.common.service.impl.CrudServiceImpl;
import io.hmit.modules.serviceOrder.dao.PensionCommunityDao;
import io.hmit.modules.serviceOrder.dto.PensionCommunityDTO;
import io.hmit.modules.serviceOrder.entity.PensionCommunityEntity;
import io.hmit.modules.serviceOrder.service.PensionCommunityService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* 社区表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-03
*/
@Service
public class PensionCommunityServiceImpl extends CrudServiceImpl<PensionCommunityDao, PensionCommunityEntity, PensionCommunityDTO> implements PensionCommunityService {
@Override
public QueryWrapper<PensionCommunityEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
QueryWrapper<PensionCommunityEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
return wrapper;
}
}
\ No newline at end of file
......@@ -17,6 +17,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
......@@ -91,5 +92,18 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
return pensionOrderDTO;
}
@Override
public PageData<PensionOrderDTO> getElderTodayOrderPage(Map<String, Object> params, Long creator) {
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
IPage<PensionOrderDTO> pensionOrderDTOIPage = pensionOrderDao.getElderTodayOrderPage(page, creator);
return getPageData(pensionOrderDTOIPage, PensionOrderDTO.class);
}
@Override
public PageData<PensionOrderDTO> getElderAllOrderOrByStatusPage(Map<String, Object> params, Long creator, Integer status) {
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
List<PensionOrderDTO> list = pensionOrderDao.getElderAllOrderOrByStatusList(params, creator, status);
return getPageData(list, page.getTotal(), PensionOrderDTO.class);
}
}
......@@ -90,7 +90,7 @@ public class PensionServiceTypeServiceImpl extends CrudServiceImpl<PensionServic
List<PensionServiceTypeDTO> resultList = new ArrayList<>();
for (PensionServiceEntity pensionService:pensionServices) {
PensionServiceTypeDTO pensionServiceTypeDTO = get(pensionService.getServiceTypeId());
PensionServiceTypeDTO pensionServiceTypeDTO = get(pensionService.getServiceParentId());
resultList.add(pensionServiceTypeDTO);
}
return resultList;
......
<?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.PensionCommunityDao">
<resultMap type="io.hmit.modules.serviceOrder.entity.PensionCommunityEntity" id="pensionCommunityMap">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="deptId" column="dept_id"/>
<result property="creator" column="creator"/>
<result property="createDate" column="create_date"/>
<result property="updater" column="updater"/>
<result property="updateDate" column="update_date"/>
</resultMap>
</mapper>
\ No newline at end of file
......@@ -80,4 +80,25 @@
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 id="getElderTodayOrderPage" resultType="io.hmit.modules.serviceOrder.dto.PensionOrderDTO">
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.creator = #{creator}
</select>
<select id="getElderAllOrderOrByStatusList" resultType="io.hmit.modules.serviceOrder.dto.PensionOrderDTO">
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.creator = #{creator}
<if test="status != null">
and po.status = #{status}
</if>
</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