New file |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.model.TRegion; |
| | | import com.ruoyi.system.service.TRegionService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市管理 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-02-29 |
| | | */ |
| | | @Api(tags = "省市管理") |
| | | @RestController |
| | | @RequestMapping("/tRegion") |
| | | public class TRegionController { |
| | | |
| | | private final TRegionService regionService; |
| | | |
| | | @Autowired |
| | | public TRegionController(TRegionService regionService) { |
| | | this.regionService = regionService; |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "查询省市管理") |
| | | @GetMapping(value = "/getRegion") |
| | | public R<List<TRegion>> getRegion() { |
| | | return R.ok(regionService.getRegion()); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询省") |
| | | @PostMapping(value = "/getProvince") |
| | | public R<List<TRegion>> getProvince() { |
| | | return R.ok(regionService.list(Wrappers.lambdaQuery(TRegion.class).eq(TRegion::getParentId,0))); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.model.TSysAppUser; |
| | | import com.ruoyi.system.model.TSysChronicDisease; |
| | | import com.ruoyi.system.model.TSysInspection; |
| | | import com.ruoyi.system.query.TSysAppUserQuery; |
| | | import com.ruoyi.system.service.TSysAppUserService; |
| | | import com.ruoyi.system.service.TSysChronicDiseaseService; |
| | | import com.ruoyi.system.service.TSysInspectionService; |
| | | import com.ruoyi.system.service.TSysOrderService; |
| | | import com.ruoyi.system.vo.TSysAppUserVO; |
| | | import com.ruoyi.system.vo.TSysOrderVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2025-08-20 |
| | | */ |
| | | @Api(tags = "用户管理") |
| | | @RestController |
| | | @RequestMapping("/t-sys-app-user") |
| | | public class TSysAppUserController { |
| | | |
| | | private final TSysAppUserService sysAppUserService; |
| | | private final TSysInspectionService sysInspectionService; |
| | | private final TSysOrderService sysOrderService; |
| | | private final TSysChronicDiseaseService sysChronicDiseaseService; |
| | | @Autowired |
| | | public TSysAppUserController(TSysAppUserService sysAppUserService, TSysInspectionService sysInspectionService, TSysOrderService sysOrderService, TSysChronicDiseaseService sysChronicDiseaseService) { |
| | | this.sysAppUserService = sysAppUserService; |
| | | this.sysInspectionService = sysInspectionService; |
| | | this.sysOrderService = sysOrderService; |
| | | this.sysChronicDiseaseService = sysChronicDiseaseService; |
| | | } |
| | | |
| | | /** |
| | | * 获取用户管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取用户管理分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TSysAppUserVO>> pageList(@RequestBody TSysAppUserQuery query) { |
| | | return R.ok(sysAppUserService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取用户管理列表") |
| | | @PostMapping(value = "/list") |
| | | public R<List<TSysAppUser>> list() { |
| | | return R.ok(sysAppUserService.list(Wrappers.lambdaQuery(TSysAppUser.class) |
| | | .eq(TSysAppUser::getStatus,1) |
| | | .orderByDesc(TSysAppUser::getCreateTime))); |
| | | } |
| | | |
| | | /** |
| | | * 添加用户管理管理 |
| | | */ |
| | | @Log(title = "用户管理信息-新增用户管理", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "添加用户管理") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@Validated @RequestBody TSysAppUser dto) { |
| | | if (sysAppUserService.isExit(dto)) { |
| | | return R.fail("用户管理信息已存在"); |
| | | } |
| | | return R.ok(sysAppUserService.save(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户管理 |
| | | */ |
| | | @Log(title = "用户管理信息-修改用户管理", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改用户管理") |
| | | @PostMapping(value = "/update") |
| | | public R<Boolean> update(@Validated @RequestBody TSysAppUser dto) { |
| | | if (sysAppUserService.isExit(dto)) { |
| | | return R.fail("用户管理信息已存在"); |
| | | } |
| | | return R.ok(sysAppUserService.updateById(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 查看用户管理详情 |
| | | */ |
| | | @ApiOperation(value = "查看用户管理详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TSysAppUserVO> getDetailById(@RequestParam String id) { |
| | | TSysAppUser sysAppUser = sysAppUserService.getById(id); |
| | | TSysAppUserVO sysAppUserVO = new TSysAppUserVO(); |
| | | BeanUtils.copyProperties(sysAppUser, sysAppUserVO); |
| | | // 查询慢性病 |
| | | String chronicDiseaseId = sysAppUserVO.getChronicDiseaseId(); |
| | | if(StringUtils.isNotBlank(chronicDiseaseId)){ |
| | | String[] split = chronicDiseaseId.split(","); |
| | | List<TSysChronicDisease> sysChronicDiseases = sysChronicDiseaseService.list(Wrappers.lambdaQuery(TSysChronicDisease.class).in(TSysChronicDisease::getId, Arrays.asList(split))); |
| | | sysAppUserVO.setSysChronicDiseases(sysChronicDiseases); |
| | | } |
| | | // 查询检测信息 |
| | | List<TSysInspection> sysInspections = sysInspectionService.list(Wrappers.lambdaQuery(TSysInspection.class).eq(TSysInspection::getAppUserId, id)); |
| | | sysAppUserVO.setSysInspections(sysInspections); |
| | | // 订单信息 |
| | | List<TSysOrderVO> sysOrders = sysOrderService.queryListByAppUserId(id); |
| | | sysAppUserVO.setSysOrders(sysOrders); |
| | | return R.ok(sysAppUserVO); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户id查询检测信息 |
| | | */ |
| | | @ApiOperation(value = "根据用户id查询检测信息") |
| | | @GetMapping(value = "/getInspectionByAppUserId") |
| | | public R<List<TSysInspection>> getInspectionByAppUserId(@RequestParam String appUserId) { |
| | | // 订单信息 |
| | | List<TSysInspection> sysInspections = sysInspectionService.list(Wrappers.lambdaQuery(TSysInspection.class).eq(TSysInspection::getAppUserId, appUserId)); |
| | | return R.ok(sysInspections); |
| | | } |
| | | |
| | | /** |
| | | * 查看用户管理详情 |
| | | */ |
| | | @ApiOperation(value = "查看用户管理详情") |
| | | @GetMapping(value = "/getOrderByAppUserId") |
| | | public R<List<TSysOrderVO>> getOrderByAppUserId(@RequestParam String appUserId) { |
| | | List<TSysOrderVO> sysOrders = sysOrderService.queryListByAppUserId(appUserId); |
| | | return R.ok(sysOrders); |
| | | } |
| | | |
| | | /** |
| | | * 删除用户管理 |
| | | */ |
| | | @Log(title = "用户管理信息-删除用户管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除用户管理") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | return R.ok(sysAppUserService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除用户管理 |
| | | */ |
| | | @Log(title = "用户管理信息-删除用户管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除用户管理") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | return R.ok(sysAppUserService.removeByIds(ids)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除用户管理 |
| | | */ |
| | | @Log(title = "用户管理信息-分公司管理解冻冻结", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "分公司管理解冻冻结",notes = "状态 1=使用中 2=冻结") |
| | | @PutMapping(value = "/thawOrFreeze") |
| | | public R<Boolean> thawOrFreeze(@RequestParam(value = "id")String id, |
| | | @RequestParam(value = "status")Integer status) { |
| | | TSysAppUser sysAppUser = sysAppUserService.getById(id); |
| | | sysAppUser.setStatus(status); |
| | | sysAppUserService.updateById(sysAppUser); |
| | | if(status == 2){ |
| | | // TODO 退出账号 冻结 |
| | | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.model.TSysInspection; |
| | | import com.ruoyi.system.service.TSysInspectionService; |
| | | 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.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2025-08-20 |
| | | */ |
| | | @Api(tags = "用户检测信息管理") |
| | | @RestController |
| | | @RequestMapping("/t-sys-inspection") |
| | | public class TSysInspectionController { |
| | | |
| | | private final TSysInspectionService sysInspectionService; |
| | | @Autowired |
| | | public TSysInspectionController(TSysInspectionService sysInspectionService) { |
| | | this.sysInspectionService = sysInspectionService; |
| | | } |
| | | |
| | | // /** |
| | | // * 获取用户检测信息管理管理列表 |
| | | // */ |
| | | // @ApiOperation(value = "获取用户检测信息管理分页列表") |
| | | // @PostMapping(value = "/pageList") |
| | | // public R<PageInfo<TSysInspection>> pageList(@RequestBody TSysInspectionQuery query) { |
| | | // return R.ok(sysInspectionService.pageList(query)); |
| | | // } |
| | | |
| | | /** |
| | | * 获取用户检测信息管理管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取用户检测信息管理列表") |
| | | @PostMapping(value = "/list") |
| | | public R<List<TSysInspection>> list() { |
| | | return R.ok(sysInspectionService.list(Wrappers.lambdaQuery(TSysInspection.class).orderByDesc(TSysInspection::getCreateTime))); |
| | | } |
| | | |
| | | /** |
| | | * 添加用户检测信息管理管理 |
| | | */ |
| | | @Log(title = "用户检测信息管理信息-新增用户检测信息管理", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "添加用户检测信息管理") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@Validated @RequestBody TSysInspection dto) { |
| | | return R.ok(sysInspectionService.save(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户检测信息管理 |
| | | */ |
| | | @Log(title = "用户检测信息管理信息-修改用户检测信息管理", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改用户检测信息管理") |
| | | @PostMapping(value = "/update") |
| | | public R<Boolean> update(@Validated @RequestBody TSysInspection dto) { |
| | | return R.ok(sysInspectionService.updateById(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 查看用户检测信息管理详情 |
| | | */ |
| | | @ApiOperation(value = "查看用户检测信息管理详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TSysInspection> getDetailById(@RequestParam String id) { |
| | | return R.ok(sysInspectionService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 删除用户检测信息管理 |
| | | */ |
| | | @Log(title = "用户检测信息管理信息-删除用户检测信息管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除用户检测信息管理") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | return R.ok(sysInspectionService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除用户检测信息管理 |
| | | */ |
| | | @Log(title = "用户检测信息管理信息-删除用户检测信息管理", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除用户检测信息管理") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | return R.ok(sysInspectionService.removeByIds(ids)); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void insertFill(MetaObject metaObject) { |
| | | // 获取登录信息 |
| | | String userName = SecurityUtils.getUsername(); |
| | | String userName = SecurityUtils.getLoginUser().getUser().getNickName(); |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if (StringUtils.isNotBlank(userName)) { |
| | | this.setFieldValByName("createBy", userName, metaObject); |
| | | this.setFieldValByName("createId", userId, metaObject); |
| | | this.setFieldValByName("updateBy", userName, metaObject); |
| | | } else { |
| | | this.setFieldValByName("createBy", userName, metaObject); |
| | | this.setFieldValByName("createId", userId, metaObject); |
| | | this.setFieldValByName("updateBy", userName, metaObject); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | // 获取登录信息 |
| | | String userName = SecurityUtils.getUsername(); |
| | | String userName = SecurityUtils.getLoginUser().getUser().getNickName(); |
| | | if (StringUtils.isNotBlank(userName)){ |
| | | this.setFieldValByName("createBy", userName, metaObject); |
| | | this.setFieldValByName("updateBy", userName, metaObject); |
| | | } else { |
| | | this.setFieldValByName("createBy", userName, metaObject); |
| | | this.setFieldValByName("updateBy", userName, metaObject); |
| | | } |
| | | |
New file |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.model.TRegion; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-02-29 |
| | | */ |
| | | @Mapper |
| | | public interface TRegionMapper extends BaseMapper<TRegion> { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TSysAppUser; |
| | | import com.ruoyi.system.query.TSysAppUserQuery; |
| | | import com.ruoyi.system.vo.TSysAppUserVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TSysAppUserMapper extends BaseMapper<TSysAppUser> { |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @param pageInfo |
| | | * @return |
| | | */ |
| | | List<TSysAppUserVO> pageList(@Param("query") TSysAppUserQuery query, @Param("pageInfo")PageInfo<TSysAppUserVO> pageInfo); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.model.TSysOrder; |
| | | import com.ruoyi.system.vo.TSysOrderVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TSysOrderMapper extends BaseMapper<TSysOrder> { |
| | | |
| | | /** |
| | | * 根据appUserId查询订单列表 |
| | | * |
| | | * @param id appUserId |
| | | * @return 订单列表 |
| | | */ |
| | | List<TSysOrderVO> queryListByAppUserId(@Param("id") String id); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市管理 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-02-29 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @TableName("t_region") |
| | | @ApiModel(value="TRegion对象", description="省市管理") |
| | | public class TRegion implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "城市名称") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "城市代码") |
| | | @TableField("code") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "城市code") |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | |
| | | @ApiModelProperty(value = "父级ID") |
| | | @TableField("parentId") |
| | | private Long parentId; |
| | | |
| | | @ApiModelProperty(value = "英文名称") |
| | | @TableField("english") |
| | | private String english; |
| | | |
| | | @ApiModelProperty(value = "首字母") |
| | | @TableField("initial") |
| | | private String initial; |
| | | |
| | | @ApiModelProperty(value = "子项") |
| | | @TableField(exist = false) |
| | | private List<TRegion> children; |
| | | |
| | | } |
| | |
| | | @TableField("open_id") |
| | | private String openId; |
| | | |
| | | @ApiModelProperty(value = "慢性病id,逗号分割") |
| | | @TableField("chronic_disease_id") |
| | | private String chronicDiseaseId; |
| | | |
| | | @ApiModelProperty(value = "状态 1=使用中 2=冻结") |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | } |
| | |
| | | @TableField("app_user_id") |
| | | private String appUserId; |
| | | |
| | | @ApiModelProperty(value = "诊所id") |
| | | @TableField("clinic_id") |
| | | private String clinicId; |
| | | |
| | | @ApiModelProperty(value = "检测类型 1=诊所检测 2=小程序自检") |
| | | @TableField("inspection_type") |
| | | private Integer inspectionType; |
| | | |
| | | @ApiModelProperty(value = "检测信息") |
| | | @TableField("inspection_info") |
| | | private String inspectionInfo; |
| | | |
| | | @ApiModelProperty(value = "检测使用设备登录用户所属会员团队编码") |
| | | @TableField("team_code") |
| | | private String teamCode; |
| | | |
| | | @ApiModelProperty(value = "检测使用设备登录用户所属会员团队名称") |
| | | @TableField("team_name") |
| | | private String teamName; |
| | | |
| | | @ApiModelProperty(value = "检测使用的设备编码") |
| | | @TableField("device_code") |
| | | private String deviceCode; |
| | | |
| | | @ApiModelProperty(value = "检测使用的设备名称") |
| | | @TableField("device_name") |
| | | private String deviceName; |
| | | |
| | | @ApiModelProperty(value = "检测人名称") |
| | | @TableField("person_name") |
| | | private String personName; |
| | | |
| | | @ApiModelProperty(value = "检测人性别(1=男,2=女)") |
| | | @TableField("person_sex") |
| | | private Integer personSex; |
| | | |
| | | @ApiModelProperty(value = "检测人年龄") |
| | | @TableField("person_age") |
| | | private Integer personAge; |
| | | |
| | | @ApiModelProperty(value = "检测人手机号") |
| | | @TableField("person_phone") |
| | | private String personPhone; |
| | | |
| | | @ApiModelProperty(value = "检测人身高(单位cm)") |
| | | @TableField("person_height") |
| | | private Double personHeight; |
| | | |
| | | @ApiModelProperty(value = "检测人体重(单位kg)") |
| | | @TableField("person_weight") |
| | | private Double personWeight; |
| | | |
| | | @ApiModelProperty(value = "检测时间") |
| | | @TableField("check_time") |
| | | private String checkTime; |
| | | |
| | | @ApiModelProperty(value = "检测 PDF 报告 URL") |
| | | @TableField("pdf_url") |
| | | private String pdfUrl; |
| | | |
| | | @ApiModelProperty(value = "健康指数,其值越大表示健康状态越好") |
| | | @TableField("health_index") |
| | | private Double healthIndex; |
| | | |
| | | @ApiModelProperty(value = "体质") |
| | | @TableField("constitution_names") |
| | | private String constitutionNames; |
| | | |
| | | @ApiModelProperty(value = "证型,进一步判断体质(constitutionNames)的结果,更为准确体现用户的真实体质") |
| | | @TableField("symptom_name") |
| | | private String symptomName; |
| | | |
| | | @ApiModelProperty(value = "舌象特征分析") |
| | | @TableField("tongue_feature") |
| | | private String tongueFeature; |
| | | |
| | | @ApiModelProperty(value = "风险疾病名称") |
| | | @TableField("disease_risks") |
| | | private String diseaseRisks; |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.query; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.ruoyi.common.core.domain.model.TimeRangeQueryBody; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("用户管理查询参数TSysAppUserQuery") |
| | | public class TSysAppUserQuery extends TimeRangeQueryBody { |
| | | |
| | | |
| | | @ApiModelProperty(value = "用户姓名") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "是否慢性病患者 1=是 0=否") |
| | | private Integer isInspection; |
| | | |
| | | @ApiModelProperty(value = "状态 1=使用中 2=冻结") |
| | | private Integer status; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.model.TRegion; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市管理 服务类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-02-29 |
| | | */ |
| | | public interface TRegionService extends IService<TRegion> { |
| | | |
| | | /** |
| | | * 查询省市管理 |
| | | * @return |
| | | */ |
| | | List<TRegion> getRegion(); |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.system.model.TSysAppUser; |
| | | import com.ruoyi.system.query.TSysAppUserQuery; |
| | | import com.ruoyi.system.vo.TSysAppUserVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TSysAppUserService extends IService<TSysAppUser> { |
| | | |
| | | /** |
| | | * 分页列表 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | PageInfo<TSysAppUserVO> pageList(TSysAppUserQuery query); |
| | | |
| | | /** |
| | | * 判断是否存在 |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | boolean isExit(TSysAppUser dto); |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.model.TSysOrder; |
| | | import com.ruoyi.system.vo.TSysOrderVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TSysOrderService extends IService<TSysOrder> { |
| | | |
| | | /** |
| | | * 根据用户id查询订单列表 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<TSysOrderVO> queryListByAppUserId(String id); |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.mapper.TRegionMapper; |
| | | import com.ruoyi.system.model.TRegion; |
| | | import com.ruoyi.system.service.TRegionService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 省市管理 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author xiaochen |
| | | * @since 2024-02-29 |
| | | */ |
| | | @Service |
| | | public class TRegionServiceImpl extends ServiceImpl<TRegionMapper, TRegion> implements TRegionService { |
| | | |
| | | @Override |
| | | public List<TRegion> getRegion() { |
| | | List<TRegion> tRegions = this.baseMapper.selectList(Wrappers.lambdaQuery(TRegion.class)); |
| | | List<TRegion> parent = tRegions.stream().filter(e -> e.getParentId().equals(0L)).collect(Collectors.toList()); |
| | | for (TRegion region : parent) { |
| | | List<TRegion> children = tRegions.stream().filter(e -> e.getParentId().equals(region.getId())).collect(Collectors.toList()); |
| | | region.setChildren(children); |
| | | } |
| | | return parent; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.mapper.TSysAppUserMapper; |
| | | import com.ruoyi.system.model.TSysAppUser; |
| | | import com.ruoyi.system.model.TSysActivity; |
| | | import com.ruoyi.system.model.TSysAppUser; |
| | | import com.ruoyi.system.query.TSysAppUserQuery; |
| | | import com.ruoyi.system.service.TSysAppUserService; |
| | | import com.ruoyi.system.vo.TSysAppUserVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TSysAppUserServiceImpl extends ServiceImpl<TSysAppUserMapper, TSysAppUser> implements TSysAppUserService { |
| | | |
| | | @Override |
| | | public PageInfo<TSysAppUserVO> pageList(TSysAppUserQuery query) { |
| | | PageInfo<TSysAppUserVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TSysAppUserVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isExit(TSysAppUser dto) { |
| | | if(StringUtils.isNotEmpty(dto.getId())){ |
| | | // 修改 |
| | | return this.count(Wrappers.lambdaQuery(TSysAppUser.class).ne(TSysAppUser::getId, dto.getId()).eq(TSysAppUser::getPhone, dto.getPhone())) > 0; |
| | | }else { |
| | | // 新增 |
| | | return this.count(Wrappers.lambdaQuery(TSysAppUser.class).eq(TSysAppUser::getPhone, dto.getPhone())) > 0; |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.mapper.TSysOrderGoodsMapper; |
| | | import com.ruoyi.system.mapper.TSysOrderMapper; |
| | | import com.ruoyi.system.model.TSysOrder; |
| | | import com.ruoyi.system.model.TSysOrderGoods; |
| | | import com.ruoyi.system.service.TSysOrderService; |
| | | import com.ruoyi.system.vo.TSysOrderVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TSysOrderServiceImpl extends ServiceImpl<TSysOrderMapper, TSysOrder> implements TSysOrderService { |
| | | |
| | | @Autowired |
| | | private TSysOrderGoodsMapper sysOrderGoodsMapper; |
| | | |
| | | @Override |
| | | public List<TSysOrderVO> queryListByAppUserId(String id) { |
| | | List<TSysOrderVO> sysOrderVOS = this.baseMapper.queryListByAppUserId(id); |
| | | if(CollectionUtils.isEmpty(sysOrderVOS)){ |
| | | return sysOrderVOS; |
| | | } |
| | | List<String> orderIds = sysOrderVOS.stream().map(TSysOrderVO::getId).collect(Collectors.toList()); |
| | | List<TSysOrderGoods> sysOrderGoodsList = sysOrderGoodsMapper.selectList(Wrappers.lambdaQuery(TSysOrderGoods.class) |
| | | .in(TSysOrderGoods::getOrderId, orderIds)); |
| | | for (TSysOrderVO sysOrderVO : sysOrderVOS) { |
| | | sysOrderVO.setSysOrderGoods(sysOrderGoodsList.stream().filter(sysOrderGoods -> sysOrderGoods.getOrderId().equals(sysOrderVO.getId())).collect(Collectors.toList())); |
| | | } |
| | | return this.baseMapper.queryListByAppUserId(id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.system.model.TSysAppUser; |
| | | import com.ruoyi.system.model.TSysChronicDisease; |
| | | import com.ruoyi.system.model.TSysInspection; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "用户管理对象TSysAppUserVO") |
| | | public class TSysAppUserVO extends TSysAppUser { |
| | | |
| | | @ApiModelProperty(value = "是否慢性病患者 1=是 0=否") |
| | | private Integer isInspection; |
| | | |
| | | @ApiModelProperty(value = "最近检测时间") |
| | | private String lastInspectionTime; |
| | | |
| | | @ApiModelProperty(value = "慢性病列表") |
| | | private List<TSysChronicDisease> sysChronicDiseases; |
| | | |
| | | @ApiModelProperty(value = "检测列表") |
| | | private List<TSysInspection> sysInspections; |
| | | |
| | | @ApiModelProperty(value = "购药信息列表") |
| | | private List<TSysOrderVO> sysOrders; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import com.ruoyi.system.model.TSysOrder; |
| | | import com.ruoyi.system.model.TSysOrderGoods; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "订单信息VO") |
| | | public class TSysOrderVO extends TSysOrder { |
| | | |
| | | @ApiModelProperty(value = "订单商品列表") |
| | | private List<TSysOrderGoods> sysOrderGoods; |
| | | |
| | | } |
New 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="com.ruoyi.system.mapper.TRegionMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TRegion"> |
| | | <id column="id" property="id" /> |
| | | <result column="name" property="name" /> |
| | | <result column="code" property="code" /> |
| | | <result column="cityCode" property="cityCode" /> |
| | | <result column="parentId" property="parentId" /> |
| | | <result column="english" property="english" /> |
| | | <result column="initial" property="initial" /> |
| | | </resultMap> |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, `name`, code, cityCode, parentId, english, initial |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | <result column="birth_time" property="birthTime" /> |
| | | <result column="sex" property="sex" /> |
| | | <result column="open_id" property="openId" /> |
| | | <result column="chronic_disease_id" property="chronicDiseaseId" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, nick_name, phone, birth_time, sex, open_id, create_time, update_time, create_by, update_by, disabled |
| | | id, nick_name, phone, birth_time, sex, open_id,chronic_disease_id, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TSysAppUserVO"> |
| | | select tsau.id, tsau.nick_name, tsau.phone, tsau.birth_time, tsau.sex, tsau.open_id, |
| | | tsau.chronic_disease_id, tsau.create_time, tsau.update_time, tsau.create_by, |
| | | tsau.update_by, tsau.disabled, tsi.lastInspectionTime |
| | | from t_sys_app_user tsau |
| | | left join (select id,app_user_id, max(check_time) as lastInspectionTime from t_sys_inspection limit 1) tsi on tsi.app_user_id = tsau.id |
| | | <where> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and phone = #{query.phone} |
| | | </if> |
| | | <if test="query.nickName != null and query.nickName != ''"> |
| | | and nick_name like concat('%',#{query.nickName},'%') |
| | | </if> |
| | | <if test="query.startTime != null and query.startTime != '' and query.endTime != null and query.endTime != ''"> |
| | | and tsau.id in (select app_user_id from t_sys_inspection where check_time between #{query.startTime} and #{query.endTime}) |
| | | </if> |
| | | <if test="query.isInspection != null and query.isInspection == 1"> |
| | | and tsau.chronic_disease_id IS NOT NULL |
| | | </if> |
| | | <if test="query.isInspection != null and query.isInspection == 0"> |
| | | and tsau.chronic_disease_id IS NULL |
| | | </if> |
| | | <if test="query.status != null"> |
| | | and tsau.status = #{query.status} |
| | | </if> |
| | | AND tsau.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY tsau.create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.system.model.TSysInspection"> |
| | | <id column="id" property="id" /> |
| | | <result column="app_user_id" property="appUserId" /> |
| | | <result column="clinic_id" property="clinicId" /> |
| | | <result column="inspection_type" property="inspectionType" /> |
| | | <result column="inspection_info" property="inspectionInfo" /> |
| | | <result column="team_code" property="teamCode" /> |
| | | <result column="team_name" property="teamName" /> |
| | | <result column="device_code" property="deviceCode" /> |
| | | <result column="device_name" property="deviceName" /> |
| | | <result column="person_name" property="personName" /> |
| | | <result column="person_sex" property="personSex" /> |
| | | <result column="person_age" property="personAge" /> |
| | | <result column="person_phone" property="personPhone" /> |
| | | <result column="person_height" property="personHeight" /> |
| | | <result column="person_weight" property="personWeight" /> |
| | | <result column="check_time" property="checkTime" /> |
| | | <result column="pdf_url" property="pdfUrl" /> |
| | | <result column="health_index" property="healthIndex" /> |
| | | <result column="constitution_names" property="constitutionNames" /> |
| | | <result column="symptom_name" property="symptomName" /> |
| | | <result column="tongue_feature" property="tongueFeature" /> |
| | | <result column="disease_risks" property="diseaseRisks" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, inspection_info, create_time, update_time, create_by, update_by, disabled |
| | | id, app_user_id,clinic_id, inspection_info, team_code, team_name, device_code, device_name, person_name, person_sex, person_age, person_phone, person_height, person_weight, check_time, pdf_url, health_index, constitution_names, symptom_name, tongue_feature, disease_risks, create_time, update_time, create_by, update_by, disabled, create_id |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, inspection_id, order_number, total_money, check_time, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="queryListByAppUserId" resultType="com.ruoyi.system.vo.TSysOrderVO"> |
| | | select |
| | | <include refid="Base_Column_List"/> |
| | | from t_sys_order |
| | | where app_user_id = #{appUserId} and disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()} |
| | | </select> |
| | | |
| | | </mapper> |