Commit f6d6c3b0 by 杨伟程

老人代码修改

parent 84d31e3e
Showing with 191 additions and 25 deletions
......@@ -6,8 +6,8 @@ import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.elder.PlatElderChildrenInfoEditVO;
import com.makeit.dto.platform.elder.PlatElderChildrenInfoQueryDTO;
import com.makeit.dto.platform.elder.children.PlatElderChildrenInfoEditVO;
import com.makeit.dto.platform.elder.children.PlatElderChildrenInfoQueryDTO;
import com.makeit.service.platform.elder.PlatElderChildrenInfoService;
import com.makeit.vo.platform.elder.PlatElderChildrenInfoListVO;
import io.swagger.annotations.Api;
......
......@@ -7,17 +7,20 @@ import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.elder.*;
import com.makeit.common.vo.ExcelImportVo;
import com.makeit.dto.platform.elder.PlatElderCheckInDTO;
import com.makeit.dto.platform.elder.PlatElderCheckOutDTO;
import com.makeit.dto.platform.elder.PlatElderQueryDTO;
import com.makeit.dto.platform.elder.add.PlatElderAddDTO;
import com.makeit.dto.platform.elder.add.PlatElderDTOVO;
import com.makeit.service.platform.elder.PlatElderService;
import com.makeit.vo.platform.elder.PlatElderListVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
......@@ -56,6 +59,20 @@ public class PlatElderController {
platElderService.exportExcel(response, dto);
}
@ApiOperation(value = "导出模板")
@PostMapping("/exportTemplate")
public void exportTemplate(HttpServletResponse response) {
platElderService.exportTemplate(response);
}
@ApiOperation(value = "导入")
@PostMapping("/importExcel")
public ApiResponseEntity<ExcelImportVo> importExcel(
@RequestParam(value = "excelFile", required = true) MultipartFile excelFile) throws Exception {
return ApiResponseUtils.success(platElderService.importExcel(excelFile));
}
@ApiOperation("新增")
@PostMapping("add")
public ApiResponseEntity<?> add(@Validated @RequestBody PlatElderAddDTO dto) {
......
......@@ -6,7 +6,7 @@ import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.elder.PlatElderPhysicalReportDTOVO;
import com.makeit.dto.platform.elder.add.PlatElderPhysicalReportDTOVO;
import com.makeit.service.platform.elder.PlatElderPhysicalReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......
......@@ -4,7 +4,7 @@ package com.makeit.module.controller.wechat.elder;
import com.makeit.common.dto.BaseIdDTO;
import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.elder.PlatElderDTOVO;
import com.makeit.dto.platform.elder.add.PlatElderDTOVO;
import com.makeit.service.platform.elder.PlatElderService;
import com.makeit.vo.wechat.elder.PlatElderWechatSimpleVO;
import io.swagger.annotations.Api;
......
package com.makeit.dto.platform.elder;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.makeit.common.dto.BaseTenantDTO;
import com.makeit.enums.biz.sys.SysConfigCategoryConst;
import com.makeit.enums.platform.elder.PlatElderEnum;
import com.makeit.global.validator.Mobile;
import com.makeit.utils.data.excel.easyexcel.ConfigConverter;
import com.makeit.utils.data.excel.easyexcel.ConfigFormat;
import com.makeit.utils.data.excel.easyexcel.DictEnumConverter;
import com.makeit.utils.data.excel.easyexcel.DictEnumFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
/**
* <p>
* 长者基本信息
* </p>
*
* @author eugene young
* @since 2023-08-29
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "Elder对象", description = "长者基本信息")
public class PlatElderImportDTO extends BaseTenantDTO {
public static final String BIG_TITLE = "导入说明:\n" +
"\n" +
"1.带*号为必填项\n" +
"\n" +
"2.证件号不可重复";
@ExcelIgnore
@ApiModelProperty(value = "小区/社区/街道空间id")
private String streetSpaceId;
@ExcelProperty({BIG_TITLE, "小区"})
@ApiModelProperty(value = "小区/社区/街道空间名称")
private String streetSpaceName;
@ExcelIgnore
@ApiModelProperty(value = "楼栋空间id")
private String buildingSpaceId;
@ExcelProperty({BIG_TITLE, "楼栋"})
@ApiModelProperty(value = "楼栋空间名称")
private String buildingSpaceName;
@ExcelIgnore
@ApiModelProperty(value = "单元空间id")
private String unitSpaceId;
@ExcelProperty({BIG_TITLE, "单元"})
@ApiModelProperty(value = "单元空间名称")
private String unitSpaceName;
@ExcelIgnore
@ApiModelProperty(value = "楼层id")
private String floorSpaceId;
@ExcelProperty({BIG_TITLE, "楼层"})
@ApiModelProperty(value = "楼层id")
private String floorSpaceName;
@ExcelIgnore
@ApiModelProperty(value = "房间id")
private String roomId;
@ExcelProperty({BIG_TITLE, "房间号"})
@ApiModelProperty(value = "房间名称")
private String roomName;
@ExcelIgnore
@ApiModelProperty(value = "床位id")
private String bedId;
@ExcelProperty({BIG_TITLE, "床位"})
@ApiModelProperty(value = "床位名称")
private String bedName;
@NotBlank(message = "姓名不能为空")
@Size(max = 50, message = "姓名最长为50字符")
@ExcelProperty({BIG_TITLE, "姓名*"})
@ApiModelProperty(value = "姓名")
private String name;
@DictEnumFormat(em = PlatElderEnum.SexEnum.class)
@ExcelProperty(value = {BIG_TITLE, "老人性别"}, converter = DictEnumConverter.class)
@ApiModelProperty(value = "性别 数据字典 1 男 2 女")
private String sex;
@ExcelProperty({BIG_TITLE, "老人姓名"})
@ApiModelProperty(value = "年龄")
private Integer age;
@NotBlank(message = "证件类型不能为空")
@ConfigFormat(categoryCode = SysConfigCategoryConst.ELDER_CERTIFICATE_TYPE)
@ExcelProperty(value = {BIG_TITLE, "证件类型*"}, converter = ConfigConverter.class)
@ApiModelProperty(value = "证件类型")
private String certificateType;
@NotBlank(message = "证件号不能为空")
@Size(max = 50, message = "证件号最长为50字符")
@ExcelProperty({BIG_TITLE, "证件号"})
@ApiModelProperty(value = "证件号码")
private String certificateNumber;
@Mobile(message = "手机号格式不对")
@ExcelProperty({BIG_TITLE, "手机号"})
@ApiModelProperty(value = "手机号码")
private String phone;
@Size(max = 50, message = "备注最长为50字符")
@ExcelProperty({BIG_TITLE, "备注"})
@ApiModelProperty(value = "备注")
private String remark;
}
package com.makeit.dto.platform.elder;
package com.makeit.dto.platform.elder.add;
import com.makeit.common.dto.BaseTenantDTO;
import com.makeit.enums.platform.elder.PlatElderEnum;
......
package com.makeit.dto.platform.elder;
package com.makeit.dto.platform.elder.add;
import com.makeit.common.dto.BaseTenantDTO;
import com.makeit.enums.platform.elder.PlatElderEnum;
......
package com.makeit.dto.platform.elder;
package com.makeit.dto.platform.elder.add;
import com.makeit.common.dto.BaseTenantDTO;
import io.swagger.annotations.ApiModel;
......
package com.makeit.dto.platform.elder;
package com.makeit.dto.platform.elder.add;
import com.makeit.common.dto.BaseTenantDTO;
import io.swagger.annotations.ApiModel;
......
package com.makeit.dto.platform.elder;
package com.makeit.dto.platform.elder.add;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.makeit.common.dto.BaseTenantDTO;
......
package com.makeit.dto.platform.elder;
package com.makeit.dto.platform.elder.add;
import com.makeit.common.dto.BaseTenantDTO;
import io.swagger.annotations.ApiModel;
......
package com.makeit.dto.platform.elder;
package com.makeit.dto.platform.elder.children;
import com.makeit.common.dto.BaseTenantDTO;
import io.swagger.annotations.ApiModel;
......
package com.makeit.dto.platform.elder;
package com.makeit.dto.platform.elder.children;
import com.makeit.common.dto.BaseTenantDTO;
import io.swagger.annotations.ApiModel;
......
package com.makeit.dto.platform.space;
import com.makeit.common.dto.BaseIdDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class TreeDTOVO extends BaseIdDTO {
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("父级id")
private String parentId;
}
......@@ -3,8 +3,8 @@ package com.makeit.service.platform.elder;
import com.baomidou.mybatisplus.extension.service.IService;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.dto.platform.elder.PlatElderChildrenInfoEditVO;
import com.makeit.dto.platform.elder.PlatElderChildrenInfoQueryDTO;
import com.makeit.dto.platform.elder.children.PlatElderChildrenInfoEditVO;
import com.makeit.dto.platform.elder.children.PlatElderChildrenInfoQueryDTO;
import com.makeit.entity.platform.elder.PlatElderChildrenInfo;
import com.makeit.vo.platform.elder.PlatElderChildrenInfoListVO;
import com.makeit.vo.wechat.elder.PlatElderChildrenInfoWechatVO;
......
......@@ -3,7 +3,7 @@ package com.makeit.service.platform.elder;
import com.baomidou.mybatisplus.extension.service.IService;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.dto.platform.elder.PlatElderPhysicalReportDTOVO;
import com.makeit.dto.platform.elder.add.PlatElderPhysicalReportDTOVO;
import com.makeit.entity.platform.elder.PlatElderPhysicalReport;
import java.util.List;
......
......@@ -3,10 +3,14 @@ package com.makeit.service.platform.elder;
import com.baomidou.mybatisplus.extension.service.IService;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.common.vo.ExcelImportVo;
import com.makeit.dto.platform.elder.*;
import com.makeit.dto.platform.elder.add.PlatElderAddDTO;
import com.makeit.dto.platform.elder.add.PlatElderDTOVO;
import com.makeit.entity.platform.elder.PlatElder;
import com.makeit.vo.platform.elder.PlatElderListVO;
import com.makeit.vo.wechat.elder.PlatElderWechatSimpleVO;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
......@@ -27,6 +31,10 @@ public interface PlatElderService extends IService<PlatElder> {
void exportExcel(HttpServletResponse response, PlatElderQueryDTO dto);
void exportTemplate(HttpServletResponse response);
ExcelImportVo importExcel(MultipartFile excelFile) throws Exception;
void add(PlatElderAddDTO dto);
void edit(PlatElderDTOVO dto);
......
......@@ -6,8 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.dto.platform.elder.PlatElderChildrenInfoEditVO;
import com.makeit.dto.platform.elder.PlatElderChildrenInfoQueryDTO;
import com.makeit.dto.platform.elder.children.PlatElderChildrenInfoEditVO;
import com.makeit.dto.platform.elder.children.PlatElderChildrenInfoQueryDTO;
import com.makeit.entity.platform.auth.PlatOrg;
import com.makeit.entity.platform.elder.PlatElder;
import com.makeit.entity.platform.elder.PlatElderChildrenInfo;
......@@ -23,7 +23,6 @@ import com.makeit.utils.data.convert.StreamUtil;
import com.makeit.utils.old.StringUtils;
import com.makeit.utils.sql.join.JoinUtil;
import com.makeit.utils.user.wechat.WechatUserUtil;
import com.makeit.vo.platform.device.PlatDeviceListVO;
import com.makeit.vo.platform.elder.PlatElderChildrenInfoListVO;
import com.makeit.vo.wechat.elder.PlatElderChildrenInfoWechatVO;
import org.springframework.beans.factory.annotation.Autowired;
......
......@@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.makeit.common.page.PageReqDTO;
import com.makeit.common.page.PageVO;
import com.makeit.dto.platform.elder.PlatElderPhysicalReportDTOVO;
import com.makeit.dto.platform.elder.add.PlatElderPhysicalReportDTOVO;
import com.makeit.entity.platform.elder.PlatElderPhysicalReport;
import com.makeit.mapper.platform.elder.PlatElderPhysicalReportMapper;
import com.makeit.service.platform.elder.PlatElderPhysicalReportService;
......
......@@ -252,7 +252,7 @@ public class PlatElderExportVO extends BaseTenantDTO {
// @ApiModelProperty(value = "婚姻")
// private String marriage;
@ExcelProperty(value = "备注")
@ApiModelProperty(value = "备注")
private String remark;
......
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 sign in to comment