| | |
| | | |
| | | @ApiModelProperty(value = "球镜") |
| | | @TableField("ballMirror") |
| | | private Integer ballMirror; |
| | | private Double ballMirror; |
| | | |
| | | @ApiModelProperty(value = "柱镜") |
| | | @TableField("columnMirror") |
| | | private Integer columnMirror; |
| | | private Double columnMirror; |
| | | |
| | | @ApiModelProperty(value = "轴位") |
| | | @TableField("axis") |
| | |
| | | package com.jilongda.manage.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.model.TAppUser; |
| | | import com.jilongda.manage.model.TLineUp; |
| | | import com.jilongda.manage.model.TOptometryDetail; |
| | | import com.jilongda.manage.query.TLineUpQuery; |
| | | import com.jilongda.manage.query.TOptometryQuery; |
| | | import com.jilongda.manage.service.TAppUserService; |
| | | import com.jilongda.manage.service.TLineUpService; |
| | | import com.jilongda.manage.vo.TOptometryVO; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/t-line-up") |
| | | public class TLineUpController { |
| | | |
| | | @Autowired |
| | | private TLineUpService lineUpService; |
| | | @Autowired |
| | | private TAppUserService appUserService; |
| | | @ApiOperation(value = "获取排号分页列表",tags = "排号管理") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TLineUp>> pageList(@RequestBody TLineUpQuery query) { |
| | | PageInfo<TLineUp> res = lineUpService.pageList(query); |
| | | return ApiResult.success(res); |
| | | } |
| | | @ApiOperation(value = "查询当前排队人数",tags = "排号a管理") |
| | | @PostMapping(value = "/getCount") |
| | | public ApiResult getCount() { |
| | | return ApiResult.success(lineUpService.lambdaQuery().eq(TLineUp::getStatus,1).list().size()); |
| | | } |
| | | @ApiOperation(value = "取消排队",tags = "排号管理") |
| | | @GetMapping(value = "/cancel") |
| | | public ApiResult cancel(Integer id) { |
| | | TLineUp byId = lineUpService.getById(id); |
| | | byId.setStatus(5); |
| | | lineUpService.updateById(byId); |
| | | return ApiResult.success(); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.jilongda.manage.controller; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.model.TAppUser; |
| | | import com.jilongda.manage.model.TOptometryDetail; |
| | | import com.jilongda.manage.model.TSupplier; |
| | | import com.jilongda.manage.query.TOptometryQuery; |
| | | import com.jilongda.manage.query.TSupplierQuery; |
| | | import com.jilongda.manage.service.TAppUserService; |
| | | import com.jilongda.manage.service.TOptometristService; |
| | | import com.jilongda.manage.service.TOptometryDetailService; |
| | | import com.jilongda.manage.service.TSupplierService; |
| | | import com.jilongda.manage.vo.TOptometryVO; |
| | | import com.jilongda.manage.vo.TSupplierVO; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @RestController |
| | | @RequestMapping("/t-optometry") |
| | | public class TOptometryController { |
| | | @Autowired |
| | | private TSupplierService supplierService; |
| | | @Autowired |
| | | private TOptometristService optometristService; |
| | | @Autowired |
| | | private TOptometryDetailService optometryDetailService; |
| | | @Autowired |
| | | private TAppUserService appUserService; |
| | | |
| | | /** |
| | | * 获取供应商列表 |
| | | */ |
| | | @ApiOperation(value = "获取验光单分页列表",tags = "验光单") |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TOptometryVO>> pageList(@RequestBody TOptometryQuery query) { |
| | | String startTime = null; |
| | | String endTime = null; |
| | | if (StringUtils.hasLength(query.getCreateTime())){ |
| | | String[] split = query.getCreateTime().split(" - "); |
| | | startTime = split[0]+" 00:00:00"; |
| | | endTime = split[1]+" 23:59:59"; |
| | | } |
| | | query.setStartTime(startTime); |
| | | query.setEndTime(endTime); |
| | | PageInfo<TOptometryVO> tOptometryVOPageInfo = optometristService.pageList(query); |
| | | List<TOptometryVO> records = tOptometryVOPageInfo.getRecords(); |
| | | for (TOptometryVO record : records) { |
| | | if (record.getUserId()!=null){ |
| | | TAppUser byId = appUserService.getById(record.getUserId()); |
| | | if (byId!=null){ |
| | | record.setName(byId.getName()); |
| | | } |
| | | } |
| | | TOptometryDetail l = optometryDetailService.lambdaQuery() |
| | | .eq(TOptometryDetail::getOptometryId, record.getId()) |
| | | .eq(TOptometryDetail::getType,1) |
| | | .eq(TOptometryDetail::getStatus,1) |
| | | .one(); |
| | | TOptometryDetail r = optometryDetailService.lambdaQuery() |
| | | .eq(TOptometryDetail::getOptometryId, record.getId()) |
| | | .eq(TOptometryDetail::getType,1) |
| | | .eq(TOptometryDetail::getStatus,2) |
| | | .one(); |
| | | double templ = 0.0; |
| | | double tempr = 0.0; |
| | | if (l!=null){ |
| | | record.setLValue(l.getBallMirror().toString()+(l.getColumnMirror()!=null?"-"+l.getColumnMirror():"")); |
| | | templ = Double.parseDouble(l.getPupilDistance()); |
| | | } |
| | | if (r!=null){ |
| | | record.setRValue(r.getBallMirror().toString()+(r.getColumnMirror()!=null?"-"+r.getColumnMirror():"")); |
| | | tempr = Double.parseDouble(r.getPupilDistance()); |
| | | |
| | | } |
| | | record.setPupilDistance((templ+tempr)+""); |
| | | } |
| | | return ApiResult.success(tOptometryVOPageInfo); |
| | | } |
| | | @ApiOperation(value = "查询验光单详情",tags = "验光单") |
| | | @GetMapping(value = "/getDetailById") |
| | | public ApiResult<List<TOptometryDetail>> getDetailById(@RequestParam Integer id) { |
| | | List<TOptometryDetail> list = optometryDetailService.lambdaQuery() |
| | | .eq(TOptometryDetail::getOptometryId, id) |
| | | .list(); |
| | | return ApiResult.success(list); |
| | | } |
| | | } |
| | | |
| | |
| | | package com.jilongda.manage.mapper; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.model.TLineUp; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.manage.query.TLineUpQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TLineUpMapper extends BaseMapper<TLineUp> { |
| | | |
| | | List<TLineUp> pageList(@Param("query")TLineUpQuery query, @Param("pageInfo") PageInfo<TLineUp> pageInfo); |
| | | |
| | | } |
| | |
| | | package com.jilongda.manage.mapper; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.model.TOptometrist; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.jilongda.manage.query.TOptometryQuery; |
| | | import com.jilongda.manage.query.TSupplierQuery; |
| | | import com.jilongda.manage.vo.TOptometryVO; |
| | | import com.jilongda.manage.vo.TSupplierVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TOptometristMapper extends BaseMapper<TOptometrist> { |
| | | |
| | | List<TOptometryVO> pageList(@Param("query")TOptometryQuery query, @Param("pageInfo")PageInfo<TOptometryVO> pageInfo); |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "编号") |
| | | @TableField("code") |
| | | private String code; |
| | | @ApiModelProperty(value = "微信名称") |
| | | @TableField(exist = false) |
| | | private String name; |
| | | @ApiModelProperty(value = "手机号") |
| | | @TableField(exist = false) |
| | | private String phone; |
| | | @ApiModelProperty(value = "验光师") |
| | | @TableField(exist = false) |
| | | private String optometrist; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("userId") |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.jilongda.common.pojo.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | private Integer gender; |
| | | |
| | | @ApiModelProperty(value = "姓名") |
| | | @TableField("name") |
| | | private String name; |
| | | @TableField("realName") |
| | | private String realName; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | @TableField("phone") |
| | |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "注册时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") |
| | | @TableField("registerTime") |
| | | private LocalDateTime registerTime; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "球镜") |
| | | @TableField("ballMirror") |
| | | private Integer ballMirror; |
| | | private Double ballMirror; |
| | | |
| | | @ApiModelProperty(value = "柱镜") |
| | | @TableField("columnMirror") |
| | | private Integer columnMirror; |
| | | private Double columnMirror; |
| | | |
| | | @ApiModelProperty(value = "轴位") |
| | | @TableField("axis") |
New file |
| | |
| | | package com.jilongda.manage.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "排号管理查询参数") |
| | | public class TLineUpQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "微信昵称") |
| | | private String name; |
| | | @ApiModelProperty(value = "门店id") |
| | | private Integer storeId; |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | @ApiModelProperty(value = "状态1排队中2验光中3已完成4已过号5已取消") |
| | | private Integer status; |
| | | |
| | | } |
New file |
| | |
| | | package com.jilongda.manage.query; |
| | | |
| | | import com.jilongda.common.pojo.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "验光单查询参数") |
| | | public class TOptometryQuery extends BasePage { |
| | | |
| | | @ApiModelProperty(value = "微信昵称") |
| | | private String name; |
| | | @ApiModelProperty(value = "姓名") |
| | | private String realName; |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | @ApiModelProperty(value = "出单日期 2020-11-11 - 2022-11-11") |
| | | private String createTime; |
| | | @ApiModelProperty(value = "店铺id") |
| | | private Integer storeId; |
| | | @ApiModelProperty(value = "验光师id") |
| | | private Integer optometristId; |
| | | @ApiModelProperty(value = "开始时间 前端忽略") |
| | | private String startTime; |
| | | @ApiModelProperty(value = "结束时间 前端忽略") |
| | | private String endTime; |
| | | } |
| | |
| | | package com.jilongda.manage.service; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.model.TLineUp; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.manage.query.TLineUpQuery; |
| | | import com.jilongda.manage.vo.TOptometryVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TLineUpService extends IService<TLineUp> { |
| | | |
| | | PageInfo<TLineUp> pageList(TLineUpQuery query); |
| | | |
| | | } |
| | |
| | | package com.jilongda.manage.service; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.model.TOptometrist; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.jilongda.manage.query.TOptometryQuery; |
| | | import com.jilongda.manage.vo.TOptometryVO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface TOptometristService extends IService<TOptometrist> { |
| | | |
| | | PageInfo<TOptometryVO> pageList(TOptometryQuery query); |
| | | } |
| | |
| | | package com.jilongda.manage.service.impl; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.model.TLineUp; |
| | | import com.jilongda.manage.mapper.TLineUpMapper; |
| | | import com.jilongda.manage.query.TLineUpQuery; |
| | | import com.jilongda.manage.service.TLineUpService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.manage.vo.TOptometryVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TLineUpServiceImpl extends ServiceImpl<TLineUpMapper, TLineUp> implements TLineUpService { |
| | | |
| | | @Override |
| | | public PageInfo<TLineUp> pageList(TLineUpQuery query) { |
| | | PageInfo<TLineUp> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TLineUp> list=this.baseMapper.pageList(query, pageInfo); |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
| | |
| | | package com.jilongda.manage.service.impl; |
| | | |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.mapper.TOptometryMapper; |
| | | import com.jilongda.manage.model.TOptometrist; |
| | | import com.jilongda.manage.mapper.TOptometristMapper; |
| | | import com.jilongda.manage.query.TOptometryQuery; |
| | | import com.jilongda.manage.service.TOptometristService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.jilongda.manage.vo.TOptometryVO; |
| | | import com.jilongda.manage.vo.TSupplierVO; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.checkerframework.checker.units.qual.A; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class TOptometristServiceImpl extends ServiceImpl<TOptometristMapper, TOptometrist> implements TOptometristService { |
| | | @Override |
| | | public PageInfo<TOptometryVO> pageList(TOptometryQuery query) { |
| | | PageInfo<TOptometryVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TOptometryVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.manage.utils; |
| | | |
| | | |
| | | import com.jilongda.manage.model.TLineUp; |
| | | import com.jilongda.manage.service.TLineUpService; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 定时任务工具类 |
| | | */ |
| | | @Component |
| | | public class TaskUtil { |
| | | |
| | | @Resource |
| | | private TLineUpService lineUpService; |
| | | |
| | | // 每天晚上9点执行的定时任务 |
| | | @Scheduled(cron = "0 0 23 * * ?") |
| | | public void taskNineDay() { |
| | | try { |
| | | System.err.println("执行每天晚上定时任务 排号修改状态"); |
| | | List<TLineUp> list = lineUpService.lambdaQuery().eq(TLineUp::getStatus, 1).list(); |
| | | for (TLineUp tLineUp : list) { |
| | | tLineUp.setStatus(5); |
| | | } |
| | | lineUpService.updateBatchById(list); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.jilongda.manage.vo; |
| | | |
| | | import com.jilongda.manage.model.TOptometry; |
| | | import com.jilongda.manage.model.TSupplier; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "验光单VO") |
| | | public class TOptometryVO extends TOptometry { |
| | | @ApiModelProperty(value = "门店名称") |
| | | private String storeName; |
| | | @ApiModelProperty(value = "微信名称") |
| | | private String name; |
| | | @ApiModelProperty(value = "R值") |
| | | private String rValue; |
| | | @ApiModelProperty(value = "L值") |
| | | private String lValue; |
| | | @ApiModelProperty(value = "瞳距") |
| | | private String pupilDistance; |
| | | @ApiModelProperty(value = "验光师名称") |
| | | private String optometristName; |
| | | |
| | | } |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, code, userId, optometristId, storeId, status, createTime, updateTime, createBy, updateBy, isDelete |
| | | </sql> |
| | | <select id="pageList" resultType="com.jilongda.manage.model.TLineUp"> |
| | | select t.*,u.name,u.phone,u.age,u.gender,u.realName,s.name storeName,o.name optometrist |
| | | from t_line_up t |
| | | left join t_user u on t.userId = u.id |
| | | left join t_optometrist o on t.optometristId = o.id |
| | | left join t_store s on t.storeId = s.id |
| | | <where> |
| | | <if test="query.status != null"> |
| | | and t.status = #{query.status} |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | AND u.phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | <if test="query.name != null and query.name != ''"> |
| | | AND u.name like concat('%',#{query.name},'%') |
| | | </if> |
| | | <if test="query.storeId != null"> |
| | | and s.id = #{query.storeId} |
| | | </if> |
| | | </where> |
| | | order by t.createTime desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, name, phone, status, storeId, img, registerTime, createTime, updateTime, createBy, updateBy, isDelete |
| | | </sql> |
| | | <select id="pageList" resultType="com.jilongda.manage.vo.TOptometryVO"> |
| | | select t1.id, t1.code, t1.userId, t1.age, t1.gender, |
| | | t1.realName, t1.phone, t1.optometristId, |
| | | t1.storeId, t1.status, t1.registerTime, |
| | | t1.createTime, t1.updateTime, t1.createBy, |
| | | t1.updateBy, t1.isDelete,t2.`name`, |
| | | t3.name as storeName,t4.name as optometristName |
| | | from t_optometry t1 |
| | | left join t_app_user t2 on t1.userId = t2.id |
| | | left join t_store t3 on t1.storeId = t3.id |
| | | left join t_optometrist t4 on t1.optometristId = t4.id |
| | | <where> |
| | | <if test="query.name != null and query.name != ''"> |
| | | and t2.`name` like concat('%',#{query.name},'%') |
| | | </if> |
| | | <if test="query.realName != null and query.realName != ''"> |
| | | and t1.`name` like concat('%',#{query.realName},'%') |
| | | </if> |
| | | <if test="query.phone != null and query.phone != ''"> |
| | | and t1.phone like concat('%',#{query.phone},'%') |
| | | </if> |
| | | <if test="query.storeId != null and query.storeId != ''"> |
| | | and t1.storeId = #{query.storeId} |
| | | </if> |
| | | <if test="query.optometristId != null and query.optometristId != ''"> |
| | | and t1.optometristId = #{query.optometristId} |
| | | </if> |
| | | <if test="req.startTime != null and req.startTime!=''"> |
| | | and (t1.createTime between #{req.startTime} and #{req.endTime}) |
| | | </if> |
| | | AND t3.type=1 |
| | | AND isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} |
| | | </where> |
| | | ORDER BY createTime DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="userId" property="userId" /> |
| | | <result column="age" property="age" /> |
| | | <result column="gender" property="gender" /> |
| | | <result column="name" property="name" /> |
| | | <result column="realName" property="realName" /> |
| | | <result column="phone" property="phone" /> |
| | | <result column="optometristId" property="optometristId" /> |
| | | <result column="storeId" property="storeId" /> |
| | |
| | | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, code, userId, age, gender, name, phone, optometristId, storeId, status, registerTime, createTime, updateTime, createBy, updateBy, isDelete |
| | | id, code, userId, age, gender, realName, phone, optometristId, storeId, status, registerTime, createTime, updateTime, createBy, updateBy, isDelete |
| | | </sql> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | @ApiModelProperty(value = "球镜") |
| | | @TableField("ballMirror") |
| | | private Integer ballMirror; |
| | | private Double ballMirror; |
| | | |
| | | @ApiModelProperty(value = "柱镜") |
| | | @TableField("columnMirror") |
| | | private Integer columnMirror; |
| | | private Double columnMirror; |
| | | |
| | | @ApiModelProperty(value = "轴位") |
| | | @TableField("axis") |