1.用户注册,消费记录,续费记录,添加用户,重置密码,设为管理员接口增加
2.修改管理后台关联的改动。
19 files modified
7 files added
New file |
| | |
| | | package com.kidgrow.oprationcenter.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.kidgrow.common.model.SuperModel; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | import org.hibernate.validator.constraints.NotEmpty; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @version 1.0 |
| | | * @Description: 产品/明显的充值记录<br> |
| | | * @Project: 用户中心<br> |
| | | * @CreateDate: Created in 2020-04-01 09:37:05 <br> |
| | | * @Author: <a href="4345453@kidgrow.com">liuke</a> |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @TableName("product_order_record") |
| | | public class ProductOrderRecord extends SuperModel { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 对应product_order表中的id |
| | | */ |
| | | @NotEmpty(message = "对应product_order表中的id不能为空") |
| | | private Long orderId; |
| | | /** |
| | | * 产品/明细ID |
| | | */ |
| | | @NotEmpty(message = "产品/明细ID不能为空") |
| | | private Long proId; |
| | | /** |
| | | * 产品/明细名称 |
| | | */ |
| | | @NotEmpty(message = "产品/明细名称不能为空") |
| | | private String proName; |
| | | /** |
| | | * 产品类型 0试用 1正式 |
| | | */ |
| | | @NotNull(message = "产品类型不能为空") |
| | | private Integer proType; |
| | | /** |
| | | * 是否共享 0否 1是 |
| | | */ |
| | | @NotEmpty(message = "是否共享不能为空") |
| | | private Boolean isShare; |
| | | /** |
| | | * 是否删除,1删除,0未删除 |
| | | */ |
| | | @TableLogic |
| | | @NotEmpty(message = "是否删除,1删除,0未删除不能为空") |
| | | private Boolean isDel; |
| | | /** |
| | | * 读片量 |
| | | */ |
| | | @NotEmpty(message = "读片量不能为空") |
| | | private Integer ailightCount; |
| | | /** |
| | | * 报告量 |
| | | */ |
| | | @NotEmpty(message = "报告量不能为空") |
| | | private Integer recordCount; |
| | | /** |
| | | * 有效的开始时间 |
| | | */ |
| | | private Date proBegintime; |
| | | /** |
| | | * 有效的结束时间 |
| | | */ |
| | | private Date proEndtime; |
| | | /** |
| | | * 状态,1启用,0停用 |
| | | */ |
| | | private Boolean enabled; |
| | | /** |
| | | * 创建者的部门 |
| | | */ |
| | | private String createUserOrgCode; |
| | | } |
| | |
| | | */ |
| | | private String proName; |
| | | /** |
| | | * 医院id |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long hospitalId; |
| | | /** |
| | | * 医院名称 |
| | | */ |
| | | private String hospitalName; |
| | | /** |
| | | * 科室id |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long departmentId; |
| | | /** |
| | | * 科室名称 |
| | | */ |
| | | private String departmentName; |
| | |
| | | */ |
| | | List<ProductOrderDetail> findList(Page<ProductOrderDetail> page, @Param("p") Map<String, Object> params); |
| | | /** |
| | | * 分页查询产品/明显的充值记录列表 |
| | | * @param page |
| | | * 查询产品/明显的充值记录列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<ProductOrderJoinDetail> findAllList(Page<ProductOrderJoinDetail> page, @Param("p") Map<String, Object> params); |
| | | List<ProductOrderJoinDetail> findAllList(@Param("p") Map<String, Object> params); |
| | | /** |
| | | * 根据ProductOrderDetail对象当做查询条件进行查询 |
| | | * @param |
New file |
| | |
| | | package com.kidgrow.oprationcenter.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.db.mapper.SuperMapper; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderRecord; |
| | | import com.kidgrow.oprationcenter.vo.GroupProductDetail; |
| | | import com.kidgrow.oprationcenter.vo.ProductOrderJoinDetail; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * @Description: 产品/明显的充值记录<br> |
| | | * @Project: 用户中心<br> |
| | | * @CreateDate: Created in 2020-04-01 09:37:05 <br> |
| | | * @Author: <a href="4345453@kidgrow.com">liuke</a> |
| | | * @version 1.0 |
| | | */ |
| | | public interface ProductOrderRecordMapper extends SuperMapper<ProductOrderRecord> { |
| | | /** |
| | | * 分页查询产品/明显的充值记录列表 |
| | | * @param page |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<ProductOrderRecord> findList(Page<ProductOrderRecord> page, @Param("p") Map<String, Object> params); |
| | | /** |
| | | * 分页查询产品/明显的充值记录列表 |
| | | * @param page |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<ProductOrderJoinDetail> findAllList(Page<ProductOrderJoinDetail> page, @Param("p") Map<String, Object> params); |
| | | /** |
| | | * 根据ProductOrderDetail对象当做查询条件进行查询 |
| | | * @param |
| | | * @return ProductOrderDetail对象 |
| | | */ |
| | | ProductOrderRecord findByObject(@Param("p") ProductOrderRecord productOrderDetail);/** |
| | | * 统计产品使用量 |
| | | * @param |
| | | * @return ProductOrderDetail对象 |
| | | */ |
| | | List<GroupProductDetail> groupProductDetail(Page<GroupProductDetail> page, @Param("p") Map<String, Object> params); |
| | | |
| | | List<ProductOrderJoinDetail> getTypeByUser(Long id); |
| | | } |
| | |
| | | import com.kidgrow.oprationcenter.vo.GroupProductDetail; |
| | | import com.kidgrow.oprationcenter.vo.ProductOrderJoinDetail; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | PageResult<ProductOrderDetail> findList(Map<String, Object> params); |
| | | /** |
| | | * 列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | PageResult<ProductOrderJoinDetail> findAllList(Map<String, Object> params, SysUser sysUser); |
| | | |
| | | /** |
| | | * 诊断列表 |
| | |
| | | ResultBody updateEnabled(Map<String, Object> params); |
| | | |
| | | ResultBody getTypeByUser(SysUser sysUser); |
| | | /** |
| | | * 获取所有的套餐记录数据 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | List<ProductOrderJoinDetail> findAllList(Map<String, Object> params); |
| | | } |
| | | |
New file |
| | |
| | | package com.kidgrow.oprationcenter.service; |
| | | |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.common.service.ISuperService; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderRecord; |
| | | import com.kidgrow.oprationcenter.vo.DiagnosisRecord; |
| | | import com.kidgrow.oprationcenter.vo.GroupProductDetail; |
| | | import com.kidgrow.oprationcenter.vo.ProductOrderJoinDetail; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * @Description: 产品/明显的充值记录<br> |
| | | * @Project: 用户中心<br> |
| | | * @CreateDate: Created in 2020-04-01 09:37:05 <br> |
| | | * @Author: <a href="4345453@kidgrow.com">liuke</a> |
| | | * @version 1.0 |
| | | */ |
| | | public interface IProductOrderRecordService extends ISuperService<ProductOrderRecord> { |
| | | /** |
| | | * 列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | PageResult<ProductOrderRecord> findList(Map<String, Object> params); |
| | | /** |
| | | * 列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | PageResult<ProductOrderJoinDetail> findAllList(Map<String, Object> params, SysUser sysUser); |
| | | |
| | | /** |
| | | * 诊断列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | PageResult<DiagnosisRecord> findAllDataList(Map<String, Object> params); |
| | | |
| | | /** |
| | | * 根据ProductOrderRecord对象当做查询条件进行查询 |
| | | * @param productOrderRecord |
| | | * @return ProductOrderRecord对象 |
| | | */ |
| | | ProductOrderRecord findByObject(ProductOrderRecord productOrderRecord); |
| | | /** |
| | | * 状态变更 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | ResultBody updateEnabled(Map<String, Object> params); |
| | | ResultBody getTypeByUser(SysUser sysUser); |
| | | /** |
| | | * 统计产品使用量列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | PageResult<GroupProductDetail> groupList(Map<String, Object> params); |
| | | |
| | | ResultBody biUserNowProduct(long hospitalId,Long departmentId); |
| | | } |
| | | |
| | |
| | | List<ProductOrderDetail> list = baseMapper.findList(page, params); |
| | | return PageResult.<ProductOrderDetail>builder().data(list).code(0).count(page.getTotal()).build(); |
| | | } |
| | | /** |
| | | * 获取已购买产品列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ProductOrderJoinDetail> findAllList(Map<String, Object> params){ |
| | | return baseMapper.findAllList(params); |
| | | } |
| | | |
| | | /** |
| | | * 获取诊断列表 |
| | |
| | | @Override |
| | | public PageResult<DiagnosisRecord> findAllDataList(Map<String, Object> params){ |
| | | return diagnosticService.getDiagnosticItemList(params).getData(); |
| | | } |
| | | /** |
| | | * 列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageResult<ProductOrderJoinDetail> findAllList(Map<String, Object> params, SysUser sysUser) { |
| | | Page<ProductOrderJoinDetail> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit")); |
| | | Map<String, Object> roleOrgMap = roleOrganizationService.getRoleOrgMap(sysUser.getRoles()); |
| | | params.putAll(roleOrgMap); |
| | | List<ProductOrderJoinDetail> list = baseMapper.findAllList(page,params); |
| | | return PageResult.<ProductOrderJoinDetail>builder().data(list).code(0).count(page.getTotal()).build(); |
| | | } |
| | | |
| | | /** |
New file |
| | |
| | | package com.kidgrow.oprationcenter.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.common.model.*; |
| | | import com.kidgrow.common.service.impl.SuperServiceImpl; |
| | | import com.kidgrow.common.utils.DateUtils; |
| | | import com.kidgrow.oprationcenter.feign.DiagnosticService; |
| | | import com.kidgrow.oprationcenter.feign.RoleOrganizationService; |
| | | import com.kidgrow.oprationcenter.mapper.ProductOrderRecordMapper; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderRecord; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderDetailService; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderRecordService; |
| | | import com.kidgrow.oprationcenter.vo.DiagnosisRecord; |
| | | import com.kidgrow.oprationcenter.vo.GroupProductDetail; |
| | | import com.kidgrow.oprationcenter.vo.ProductOrderJoinDetail; |
| | | import com.kidgrow.usercenter.feign.SysDoctorService; |
| | | import com.kidgrow.usercenter.feign.SysHospitalService; |
| | | import com.kidgrow.usercenter.model.SysHospital; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * @Description: 产品/明显的充值记录<br> |
| | | * @Project: 用户中心<br> |
| | | * @CreateDate: Created in 2020-04-01 09:37:05 <br> |
| | | * @Author: <a href="4345453@kidgrow.com">liuke</a> |
| | | * @version 1.0 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ProductOrderRecordServiceImpl extends SuperServiceImpl<ProductOrderRecordMapper, ProductOrderRecord> implements IProductOrderRecordService { |
| | | @Autowired |
| | | DiagnosticService diagnosticService; |
| | | @Autowired |
| | | private RoleOrganizationService roleOrganizationService; |
| | | @Autowired |
| | | private SysDoctorService sysDoctorService; |
| | | @Autowired |
| | | private SysHospitalService sysHospitalService; |
| | | @Autowired |
| | | private IProductOrderDetailService productOrderDetailService; |
| | | /** |
| | | * 列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageResult<ProductOrderRecord> findList(Map<String, Object> params){ |
| | | Page<ProductOrderRecord> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit")); |
| | | List<ProductOrderRecord> list = baseMapper.findList(page, params); |
| | | return PageResult.<ProductOrderRecord>builder().data(list).code(0).count(page.getTotal()).build(); |
| | | } |
| | | |
| | | /** |
| | | * 获取诊断列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageResult<DiagnosisRecord> findAllDataList(Map<String, Object> params){ |
| | | return diagnosticService.getDiagnosticItemList(params).getData(); |
| | | } |
| | | /** |
| | | * 列表 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageResult<ProductOrderJoinDetail> findAllList(Map<String, Object> params, SysUser sysUser) { |
| | | Page<ProductOrderJoinDetail> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit")); |
| | | Map<String, Object> roleOrgMap = roleOrganizationService.getRoleOrgMap(sysUser.getRoles()); |
| | | params.putAll(roleOrgMap); |
| | | List<ProductOrderJoinDetail> list = baseMapper.findAllList(page,params); |
| | | return PageResult.<ProductOrderJoinDetail>builder().data(list).code(0).count(page.getTotal()).build(); |
| | | } |
| | | |
| | | /** |
| | | * 获取统计数据 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageResult<GroupProductDetail> groupList(Map<String, Object> params) { |
| | | Page<GroupProductDetail> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit")); |
| | | List<GroupProductDetail> list = baseMapper.groupProductDetail(page,params); |
| | | return PageResult.<GroupProductDetail>builder().data(list).code(0).count(page.getTotal()).build(); |
| | | } |
| | | |
| | | /** |
| | | * 统计用户套餐使用情况 |
| | | * @param hospitalId |
| | | * @param departmentId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultBody biUserNowProduct(long hospitalId, Long departmentId) { |
| | | if (hospitalId>0&& departmentId>0) { |
| | | //查询当前医院正在使用的套餐 |
| | | Map<String,Object> selectMap=new HashMap<>(); |
| | | selectMap.put("hospitalId",hospitalId); |
| | | List<ProductOrderJoinDetail> productOrderDetailList=productOrderDetailService.findAllList(selectMap); |
| | | if (productOrderDetailList.size()>0) { |
| | | // |
| | | } |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | return ResultBody.failed("医院和科室数据有误!"); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 根据ProductOrderRecord对象当做查询条件进行查询 |
| | | * @param productOrderRecord |
| | | * @return ProductOrderRecord |
| | | */ |
| | | @Override |
| | | public ProductOrderRecord findByObject(ProductOrderRecord productOrderRecord){ |
| | | return baseMapper.findByObject(productOrderRecord); |
| | | } |
| | | /** |
| | | * 修改数据状态 启用 禁用 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultBody updateEnabled(Map<String, Object> params) { |
| | | Long id = MapUtils.getLong(params, "id"); |
| | | Boolean enabled = MapUtils.getBoolean(params, "enabled"); |
| | | |
| | | ProductOrderRecord productOrder = baseMapper.selectById(id); |
| | | if (productOrder == null) { |
| | | return ResultBody.failed("该数据不存在!"); |
| | | } |
| | | productOrder.setEnabled(enabled); |
| | | productOrder.setUpdateTime(new Date()); |
| | | int i = baseMapper.updateById(productOrder); |
| | | return i > 0 ? ResultBody.ok().data(productOrder).msg("更新成功") : ResultBody.failed("更新失败"); |
| | | } |
| | | |
| | | @Override |
| | | public ResultBody getTypeByUser(SysUser sysUser) { |
| | | List<SysOrganization> organizations = sysUser.getOrganizations(); |
| | | if(organizations.size()>0){ |
| | | SysOrganization sysOrganization = organizations.get(0); |
| | | List<ProductOrderJoinDetail> list=baseMapper.getTypeByUser(sysOrganization.getId()); |
| | | if (list.size()>0) { |
| | | ProductOrderJoinDetail productOrderJoinDetail = list.get(0); |
| | | //查询用户的真实姓名 |
| | | Map<String,Object> selectMap=new HashMap<>(); |
| | | selectMap.put("user_id",sysUser.getId()); |
| | | ResultBody listByMap = sysDoctorService.getListByMap(selectMap); |
| | | List<SysDoctor> sysDoctors = JSON.parseArray(JSON.toJSONString(listByMap.getData()), SysDoctor.class); |
| | | String str=""; |
| | | if(sysDoctors!=null&&sysDoctors.size()>0){ |
| | | str= sysDoctors.get(0).getDoctorName(); |
| | | } |
| | | //查询医院的 logo |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("id",sysOrganization.getId()); |
| | | ResultBody allByMap = sysHospitalService.findAllByMap(map); |
| | | List<SysHospital> hospitals = JSON.parseArray(JSON.toJSONString(allByMap.getData()), SysHospital.class); |
| | | String logo=""; |
| | | if(hospitals.size()>0){ |
| | | logo = hospitals.get(0).getHospitalLogo(); |
| | | } |
| | | Map<String,Object> mapVo=new HashMap<>(); |
| | | mapVo.put("type",productOrderJoinDetail.getProType()); |
| | | mapVo.put("realName",str); |
| | | //剩余时间 |
| | | Date proEndtime = productOrderJoinDetail.getProEndtime(); |
| | | Double surplusDay=DateUtils.getDays(proEndtime, new Date()); |
| | | int surplus = surplusDay.intValue(); |
| | | mapVo.put("surplus",surplus); |
| | | mapVo.put("logo",logo); |
| | | //获取 售后服务工程师********不能从sysOrganization获取,从department获取 |
| | | /* mapVo.put("saleUserName",sysOrganization.getSaleUserName()); |
| | | mapVo.put("saleUserTel",sysOrganization.getSaleUserTel());*/ |
| | | return ResultBody.ok().data(mapVo); |
| | | }else { |
| | | return ResultBody.failed("该用户套餐已经失效"); |
| | | } |
| | | }else { |
| | | return ResultBody.failed("该用户的组织已经失效"); |
| | | } |
| | | } |
| | | } |
| | |
| | | </if> |
| | | </where> |
| | | </sql> |
| | | |
| | | <!--定义根据-ProductOrderDetail当作查询条件返回对象--> |
| | | <select id="findByObject" resultType="com.kidgrow.oprationcenter.model.ProductOrderDetail"> |
| | | select |
| | |
| | | <include refid="com.kidgrow.oprationcenter.mapper.SysProductMapper.Role_Organization"></include> |
| | | </where> |
| | | </sql> |
| | | <!--查询产品的消费记录--> |
| | | <select id="findAllList" resultType="com.kidgrow.oprationcenter.vo.ProductOrderJoinDetail"> |
| | | SELECT |
| | | DE.id, |
| | | DE.ailight_count, |
| | | DE.order_id, |
| | | DE.pro_name, |
| | | DE.record_count, |
| | | DE.is_share, |
| | | DE.pro_begintime, |
| | | DE.pro_endtime, |
| | | DE.pro_id, |
| | | DE.create_time, |
| | | DE.is_del, |
| | | DE.enabled, |
| | | PRO.hospital_name, |
| | | PRO.department_name, |
| | | DE.pro_type |
| | | FROM |
| | | product_order_detail DE |
| | | LEFT JOIN product_order PRO ON DE.order_id = PRO.id |
| | | <include refid="wherelimit"/> |
| | | order by DE.id desc |
| | | </select> |
| | | <select id="groupProductDetail" resultType="com.kidgrow.oprationcenter.vo.GroupProductDetail"> |
| | | select |
| | | COUNT(DE.pro_id) pro_count, |
| | |
| | | ORDER BY |
| | | pod.pro_type desc,pod.pro_endtime desc |
| | | </select> |
| | | <!--sql查询片段--> |
| | | <sql id="whereforall"> |
| | | <where> |
| | | <!--查询条件自行添加--> |
| | | DE.is_del=0 and DE.ailight_count>0 and DE.pro_begintime <=now() and DE.pro_endtime >=now() and DE.enabled=1 |
| | | <if test="p.recordCount != null and p.recordCount !=''"> |
| | | and DE.record_count > #{p.recordCount} |
| | | </if> |
| | | <if test="p.hospitalId != null and p.hospitalId !=''"> |
| | | and DE.hospital_id = #{p.hospitalId} |
| | | </if> |
| | | </where> |
| | | </sql> |
| | | <!--查询产品的购买记录--> |
| | | <select id="findAllList" resultType="com.kidgrow.oprationcenter.vo.ProductOrderJoinDetail"> |
| | | SELECT |
| | | DE.id, |
| | | DE.ailight_count, |
| | | DE.order_id, |
| | | DE.pro_name, |
| | | DE.record_count, |
| | | DE.is_share, |
| | | DE.pro_begintime, |
| | | DE.pro_endtime, |
| | | DE.pro_id, |
| | | DE.create_time, |
| | | DE.is_del, |
| | | DE.enabled, |
| | | PRO.hospital_Id, |
| | | PRO.hospital_name, |
| | | PRO.department_id, |
| | | PRO.department_name, |
| | | DE.pro_type |
| | | FROM |
| | | product_order_detail DE |
| | | LEFT JOIN product_order PRO ON DE.order_id = PRO.id |
| | | <include refid="whereforall"/> |
| | | order by DE.pro_endtime asc,DE.id asc |
| | | </select> |
| | | </mapper> |
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.kidgrow.oprationcenter.mapper.ProductOrderRecordMapper"> |
| | | <!--定义查询列--> |
| | | <sql id="Column_List"> |
| | | * |
| | | </sql> |
| | | |
| | | <!--sql查询片段--> |
| | | <sql id="where"> |
| | | <where> |
| | | <!--查询条件自行添加--> |
| | | is_del=0 |
| | | <if test="p.id != null and p.id !=''"> |
| | | and id = #{p.id} |
| | | </if> |
| | | <if test="p.orderId != null and p.orderId !=''"> |
| | | and order_id = #{p.orderId} |
| | | </if> |
| | | <if test="p.proId != null and p.proId !=''"> |
| | | and pro_id = #{p.proId} |
| | | </if> |
| | | <if test="p.proName != null and p.proName !=''"> |
| | | and pro_name = #{p.proName} |
| | | </if> |
| | | <if test="p.isShare != null and p.isShare !=''"> |
| | | and is_share = #{p.isShare} |
| | | </if> |
| | | <if test="p.isDel != null and p.isDel !=''"> |
| | | and is_del = #{p.isDel} |
| | | </if> |
| | | <if test="p.ailightCount != null and p.ailightCount !=''"> |
| | | and ailight_count = #{p.ailightCount} |
| | | </if> |
| | | <if test="p.recordCount != null and p.recordCount !=''"> |
| | | and record_count = #{p.recordCount} |
| | | </if> |
| | | <if test="p.proBegintime != null and p.proBegintime !=''"> |
| | | and pro_begintime = #{p.proBegintime} |
| | | </if> |
| | | <if test="p.proEndtime != null and p.proEndtime !=''"> |
| | | and pro_endtime = #{p.proEndtime} |
| | | </if> |
| | | <if test="p.enabled != null and p.enabled !=''"> |
| | | and enabled = #{p.enabled} |
| | | </if> |
| | | <if test="p.createUserId != null and p.createUserId !=''"> |
| | | and create_user_id = #{p.createUserId} |
| | | </if> |
| | | <if test="p.createUserName != null and p.createUserName !=''"> |
| | | and create_user_name = #{p.createUserName} |
| | | </if> |
| | | <if test="p.updateUserId != null and p.updateUserId !=''"> |
| | | and update_user_id = #{p.updateUserId} |
| | | </if> |
| | | <if test="p.updateTime != null and p.updateTime !=''"> |
| | | and update_time = #{p.updateTime} |
| | | </if> |
| | | <if test="p.updateUserName != null and p.updateUserName !=''"> |
| | | and update_user_name = #{p.updateUserName} |
| | | </if> |
| | | <if test="p.createTime != null and p.createTime !=''"> |
| | | and create_time = #{p.createTime} |
| | | </if> |
| | | </where> |
| | | </sql> |
| | | |
| | | <!--定义根据-ProductOrderDetail当作查询条件返回对象--> |
| | | <select id="findByObject" resultType="com.kidgrow.oprationcenter.model.ProductOrderRecord"> |
| | | select |
| | | <include refid="Column_List"/> |
| | | from product_order_record |
| | | <include refid="where"/> |
| | | order by id desc |
| | | limit 1 |
| | | </select> |
| | | |
| | | <!--定义根据-ProductOrderRecord当作查询条件返回对象集合--> |
| | | <select id="findList" resultType="com.kidgrow.oprationcenter.model.ProductOrderRecord"> |
| | | select |
| | | <include refid="Column_List"/> |
| | | from product_order_record |
| | | <include refid="where"/> |
| | | order by id desc |
| | | </select> |
| | | <!--sql查询片段--> |
| | | <sql id="wherelimit"> |
| | | <where> |
| | | <!--查询条件自行添加--> |
| | | DE.is_del=0 |
| | | <if test="p.id != null and p.id !=''"> |
| | | and id = #{p.id} |
| | | </if> |
| | | <if test="p.proType != null and p.proType !=''"> |
| | | and DE.pro_type = #{p.proType} |
| | | </if> |
| | | <if test="p.enabled != null and p.enabled !=''"> |
| | | and DE.enabled = #{p.enabled} |
| | | </if> |
| | | <if test="p.hospitalName != null and p.hospitalName !=''"> |
| | | and PRO.hospital_name like concat ('%',#{p.hospitalName},'%') |
| | | </if> |
| | | <if test="p.hospitalId != null and p.hospitalId !=''"> |
| | | and PRO.hospital_id = #{p.hospitalId} |
| | | </if> |
| | | <if test="p.departmentId != null and p.departmentId !=''"> |
| | | and PRO.department_id = #{p.departmentId} |
| | | </if> |
| | | <if test="p.proName != null and p.proName !=''"> |
| | | and DE.pro_name like concat ('%',#{p.proName},'%') |
| | | </if> |
| | | <if test="p.createTime != null and p.createTime !='' and p.updateTime != null and p.updateTime !=''"> |
| | | and (DE.create_time between #{p.createTime} and #{p.updateTime}) |
| | | </if> |
| | | <if test="p.startTime!= null and p.startTime !=''"> |
| | | and DE.create_time >= #{p.startTime} |
| | | </if> |
| | | <if test="p.endTime!= null and p.endTime !=''"> |
| | | and DE.create_time <= #{p.endTime} |
| | | </if> |
| | | <include refid="com.kidgrow.oprationcenter.mapper.SysProductMapper.Role_Organization"></include> |
| | | </where> |
| | | </sql> |
| | | <!--查询产品的消费记录--> |
| | | <select id="findAllList" resultType="com.kidgrow.oprationcenter.vo.ProductOrderJoinDetail"> |
| | | SELECT |
| | | DE.id, |
| | | DE.ailight_count, |
| | | DE.order_id, |
| | | DE.pro_name, |
| | | DE.record_count, |
| | | DE.is_share, |
| | | DE.pro_begintime, |
| | | DE.pro_endtime, |
| | | DE.pro_id, |
| | | DE.create_time, |
| | | DE.is_del, |
| | | DE.enabled, |
| | | PRO.hospital_Id, |
| | | PRO.hospital_name, |
| | | PRO.department_id, |
| | | PRO.department_name, |
| | | DE.pro_type |
| | | FROM |
| | | product_order_record DE |
| | | LEFT JOIN product_order PRO ON DE.order_id = PRO.id |
| | | <include refid="wherelimit"/> |
| | | order by DE.id desc |
| | | </select> |
| | | <select id="groupProductDetail" resultType="com.kidgrow.oprationcenter.vo.GroupProductDetail"> |
| | | select |
| | | COUNT(DE.pro_id) pro_count, |
| | | max(DE.pro_name) pro_name |
| | | from product_order_record AS DE |
| | | <include refid="wherelimit"/> |
| | | GROUP BY DE.pro_id |
| | | order by pro_count desc |
| | | </select> |
| | | <select id="getTypeByUser" resultType="com.kidgrow.oprationcenter.vo.ProductOrderJoinDetail" parameterType="long"> |
| | | SELECT |
| | | pod.* |
| | | FROM |
| | | `product_order` po |
| | | INNER JOIN product_order_record pod ON po.id = pod.order_id |
| | | WHERE |
| | | po.hospital_id = #{id} |
| | | AND NOW() >= pod.pro_begintime |
| | | AND NOW() <=pod.pro_endtime |
| | | AND pod.enabled = 1 |
| | | AND pod.is_del = 0 |
| | | AND po.enabled = 1 |
| | | AND po.is_del = 0 |
| | | ORDER BY |
| | | pod.pro_type desc,pod.pro_endtime desc |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.kidgrow.common.model.SysOrganization; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderDetail; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderRecord; |
| | | import com.kidgrow.oprationcenter.service.IBusinessRecordsService; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderDetailService; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderRecordService; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderService; |
| | | import com.kidgrow.oprationcenter.vo.ProductOrderJoinDetail; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | |
| | | /** |
| | |
| | | public class ProductOrderDetailController extends BaseController { |
| | | @Autowired |
| | | private IProductOrderDetailService productOrderDetailService; |
| | | @Autowired |
| | | private IProductOrderRecordService productOrderRecordService; |
| | | @Autowired |
| | | private IBusinessRecordsService businessRecordsService; |
| | | @Autowired |
| | |
| | | return productOrderDetailService.findList(params); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | */ |
| | | @ApiOperation(value = "查询列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping("/all") |
| | | public PageResult findAllList(@RequestParam Map<String, Object> params,@LoginUser SysUser sysUser) { |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | return productOrderDetailService.findAllList(params,sysUser); |
| | | } |
| | | /** |
| | | * 列表 |
| | | */ |
| | |
| | | } |
| | | return ResultBody.failed().msg(errMsg.toString()); |
| | | } else { |
| | | //写充值套餐给用户 |
| | | Boolean v = productOrderDetailService.saveBatch(list); |
| | | if (v) { |
| | | //写充值记录 |
| | | //对象转换 |
| | | List<ProductOrderRecord> productOrderRecordList= new ArrayList<ProductOrderRecord>();; |
| | | list.forEach(item->{ |
| | | ProductOrderRecord productOrderRecord=new ProductOrderRecord(); |
| | | productOrderRecord.setAilightCount(item.getAilightCount()); |
| | | productOrderRecord.setOrderId(item.getOrderId()); |
| | | productOrderRecord.setProId(item.getProId()); |
| | | productOrderRecord.setProName(item.getProName()); |
| | | productOrderRecord.setProType(item.getProType()); |
| | | productOrderRecord.setIsShare(item.getIsShare()); |
| | | productOrderRecord.setIsDel(item.getIsDel()); |
| | | productOrderRecord.setRecordCount(item.getRecordCount()); |
| | | productOrderRecord.setProBegintime(item.getProBegintime()); |
| | | productOrderRecord.setProEndtime(item.getProEndtime()); |
| | | productOrderRecord.setEnabled(item.getEnabled()); |
| | | productOrderRecordList.add(productOrderRecord); |
| | | }); |
| | | Boolean r = productOrderRecordService.saveBatch(productOrderRecordList); |
| | | if (v&&r) { |
| | | return ResultBody.ok().data(list.size()).msg("产品充值成功"); |
| | | } else { |
| | | //写入订单明细失败,则删除订单记录数据 |
New file |
| | |
| | | package com.kidgrow.oprationcenter.controller; |
| | | |
| | | import com.kidgrow.common.annotation.LoginUser; |
| | | import com.kidgrow.common.controller.BaseController; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.common.model.SysOrganization; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.common.utils.StringUtils; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderRecord; |
| | | import com.kidgrow.oprationcenter.service.IBusinessRecordsService; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderRecordService; |
| | | import com.kidgrow.oprationcenter.service.IProductOrderService; |
| | | import com.kidgrow.oprationcenter.vo.ProductOrderJoinDetail; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections.MapUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.validation.ObjectError; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: 产品/明显的充值记录 |
| | | * @Project: 运营中心 |
| | | * @CreateDate: Created in 2020-04-02 18:25:34 <br> |
| | | * @Author: <a href="4345453@kidgrow.com">liuke</a> |
| | | * @version: 1.0 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/productorderrecord") |
| | | @Api(tags = "产品/明显的充值记录") |
| | | public class ProductOrderRecordController extends BaseController { |
| | | @Autowired |
| | | private IProductOrderRecordService productOrderRecordService; |
| | | @Autowired |
| | | private IBusinessRecordsService businessRecordsService; |
| | | @Autowired |
| | | private IProductOrderService productOrderService; |
| | | |
| | | /** |
| | | * 列表 |
| | | */ |
| | | @ApiOperation(value = "查询列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping |
| | | public PageResult list(@RequestParam Map<String, Object> params) { |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | return productOrderRecordService.findList(params); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | */ |
| | | @ApiOperation(value = "查询列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping("/all") |
| | | public PageResult findAllList(@RequestParam Map<String, Object> params,@LoginUser SysUser sysUser) { |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | String departmentId=MapUtils.getString(params, "departmentId"); |
| | | if (StringUtils.isNotBlank(departmentId)) { |
| | | params.put("enable", 1); |
| | | params.put("isDel", 0); |
| | | } |
| | | return productOrderRecordService.findAllList(params,sysUser); |
| | | } |
| | | /** |
| | | * 列表 |
| | | */ |
| | | @ApiOperation(value = "查询列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @PostMapping("/alldata") |
| | | public PageResult findAllDataList(@RequestParam Map<String, Object> params) { |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | if(params.get("diagnosticHospitalId")==null) |
| | | return PageResult.<ProductOrderJoinDetail>builder().data(null).code(0).count(0L).build(); |
| | | return productOrderRecordService.findAllDataList(params); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | */ |
| | | @ApiOperation(value = "查询列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping("/group") |
| | | public PageResult groupList(@RequestParam Map<String, Object> params) { |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | return productOrderRecordService.groupList(params); |
| | | } |
| | | |
| | | /** |
| | | * 查询 |
| | | */ |
| | | @ApiOperation(value = "查询") |
| | | @GetMapping("/{id}") |
| | | public ResultBody findById(@PathVariable Long id) { |
| | | ProductOrderRecord model = productOrderRecordService.getById(id); |
| | | return ResultBody.ok().data(model).msg("查询成功"); |
| | | } |
| | | |
| | | /** |
| | | * 根据ProductOrderRecord当做查询条件进行查询 |
| | | */ |
| | | @ApiOperation(value = "根据ProductOrderRecord当做查询条件进行查询") |
| | | @PostMapping("/query") |
| | | public ResultBody findByObject(@RequestBody ProductOrderRecord productOrderRecord) { |
| | | ProductOrderRecord model = productOrderRecordService.findByObject(productOrderRecord); |
| | | return ResultBody.ok().data(model).msg("查询成功"); |
| | | } |
| | | |
| | | /** |
| | | * 新增or更新 |
| | | */ |
| | | @ApiOperation(value = "保存") |
| | | @PostMapping |
| | | public ResultBody save(@Valid @RequestBody ProductOrderRecord productOrderRecord, BindingResult bindingResult,@LoginUser SysUser sysUser) { |
| | | List<String> errMsg = new ArrayList<>(); |
| | | if (bindingResult.hasErrors()) { |
| | | for (ObjectError error : bindingResult.getAllErrors()) { |
| | | errMsg.add(error.getDefaultMessage()); |
| | | } |
| | | return ResultBody.failed().msg(errMsg.toString()); |
| | | } else { |
| | | List<SysOrganization> organizations = sysUser.getOrganizations(); |
| | | if(organizations.size()>0){ |
| | | productOrderRecord.setCreateUserOrgCode(organizations.get(organizations.size()-1).getOrgCode()); |
| | | } |
| | | boolean v = productOrderRecordService.saveOrUpdate(productOrderRecord); |
| | | if (v) { |
| | | return ResultBody.ok().data(productOrderRecord).msg("保存成功"); |
| | | } else { |
| | | return ResultBody.failed().msg("保存失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增or更新 |
| | | */ |
| | | @ApiOperation(value = "保存") |
| | | @PostMapping("/saveall") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ResultBody batchInsert(@Valid @RequestBody List<ProductOrderRecord> list, BindingResult bindingResult) { |
| | | List<String> errMsg = new ArrayList<>(); |
| | | if (bindingResult.hasErrors()) { |
| | | for (ObjectError error : bindingResult.getAllErrors()) { |
| | | errMsg.add(error.getDefaultMessage()); |
| | | } |
| | | return ResultBody.failed().msg(errMsg.toString()); |
| | | } else { |
| | | Boolean v = productOrderRecordService.saveBatch(list); |
| | | if (v) { |
| | | return ResultBody.ok().data(list.size()).msg("产品充值成功"); |
| | | } else { |
| | | //写入订单明细失败,则删除订单记录数据 |
| | | Boolean e = productOrderService.removeById(list.get(0).getOrderId()); |
| | | if (e) |
| | | return ResultBody.failed().msg("充值数据保存失败,订单已撤回!"); |
| | | else |
| | | return ResultBody.failed().msg("充值数据保存失败,订单撤回失败!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @ApiOperation(value = "删除") |
| | | @DeleteMapping("/{id}") |
| | | public ResultBody delete(@PathVariable Long id) { |
| | | boolean v = productOrderRecordService.removeById(id); |
| | | if (v) { |
| | | if (!businessRecordsService.recordBusinessData("删除订单明细:" + id, id.toString())) { |
| | | //log.error(String.format("删除订单明细id为:{1}",id)); |
| | | } |
| | | return ResultBody.ok().msg("删除成功"); |
| | | } else { |
| | | return ResultBody.failed().msg("删除失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 修改状态 |
| | | * |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "修改数据状态") |
| | | @GetMapping("/updateEnabled") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "enabled", value = "是否启用", required = true, dataType = "Boolean") |
| | | }) |
| | | public ResultBody updateEnabled(@RequestParam Map<String, Object> params, HttpServletRequest request) { |
| | | if (params.size() == 0) { |
| | | return ResultBody.failed().msg("参数异常!"); |
| | | } |
| | | ResultBody resultBody = productOrderRecordService.updateEnabled(params); |
| | | //记录业务日志 |
| | | if (resultBody.getCode() == 0) { |
| | | String enablad = (MapUtils.getBoolean(params, "enabled")) ? "启用" : "禁用"; |
| | | if (!businessRecordsService.recordBusinessData("修改订单明细状态为:" + enablad, enablad)) { |
| | | //log.error(String.format("修改合同状态为:{0},写入业务日志失败!合同管理id为:{1}",enablad,MapUtils.getString(params,"id"))); |
| | | } |
| | | } |
| | | return resultBody; |
| | | } |
| | | |
| | | /** |
| | | * 获取 用户的状态 为试用状态还是 启用状态 |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取 用户的状态") |
| | | @GetMapping("/getTypeByUser") |
| | | public ResultBody getTypeByUser(@LoginUser SysUser sysUser) { |
| | | return productOrderRecordService.getTypeByUser(sysUser); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import com.kidgrow.common.model.SuperModel; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | |
| | | /** |
| | | * 所属医院ID |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @NotNull(message = "所属医院ID不能为空") |
| | | private Long hospitalId; |
| | | /** |
| | |
| | | /** |
| | | * 科室ID |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long departmentId; |
| | | /** |
| | | * 科室名称 |
| | |
| | | /** |
| | | * 职称ID |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long doctorRankId; |
| | | /** |
| | | * 职称 |
| | |
| | | /** |
| | | * 销售代表的id |
| | | */ |
| | | private String serverUserId; |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long serverUserId; |
| | | /** |
| | | * 销售代表名称 |
| | | */ |
| | |
| | | */ |
| | | private String nickname; |
| | | /** |
| | | * 头像Url |
| | | */ |
| | | private String headImgUrl; |
| | | /** |
| | | * 联系电话 |
| | | */ |
| | | private String mobile; |
New file |
| | |
| | | package com.kidgrow.usercenter.vo; |
| | | |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.hibernate.validator.constraints.NotEmpty; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @version 1.0 |
| | | * @Description: <br> |
| | | * @Project: H端用户注册实/添加用户实体<br> |
| | | * @CreateDate: Created in 2020-06-11 14:02:50 <br> |
| | | * @Author: <a href="411269194@kidgrow.com">hrj</a> |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class UserRegVo extends Model<UserRegVo> { |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 用户账号 |
| | | */ |
| | | @NotEmpty(message = "用户账号不能为空") |
| | | private String username; |
| | | /** |
| | | * 账号密码 |
| | | */ |
| | | @NotEmpty(message = "账号密码不能为空") |
| | | private String password; |
| | | /** |
| | | * 昵称/真实姓名 |
| | | */ |
| | | private String nickname; |
| | | /** |
| | | * 头像Url |
| | | */ |
| | | private String headImgUrl; |
| | | /** |
| | | * 联系电话 手机号 |
| | | */ |
| | | @NotEmpty(message = "手机号不能为空") |
| | | private String mobile; |
| | | /** |
| | | * 性别 |
| | | */ |
| | | private Integer sex; |
| | | /** |
| | | *来源类型 H端是 DOCTOR |
| | | */ |
| | | @NotEmpty(message = "不能为空") |
| | | private String type; |
| | | /** |
| | | *openid |
| | | */ |
| | | private String openId; |
| | | /** |
| | | * 租户字段 |
| | | */ |
| | | private String tenantId; |
| | | /** |
| | | * 是否默认密码状态 |
| | | */ |
| | | private boolean isDefaultAuth; |
| | | |
| | | /***************以下上医生信息****************/ |
| | | /** |
| | | * 所属医院ID 注册用户固定传0 |
| | | */ |
| | | @NotNull(message = "所属医院ID不能为空") |
| | | private Long hospitalId; |
| | | /** |
| | | * 医院名称 |
| | | */ |
| | | @NotEmpty(message = "医院名称不能为空") |
| | | private String hospitalName; |
| | | /** |
| | | * 科室ID 注册用户固定传0 |
| | | */ |
| | | private Long departmentId; |
| | | /** |
| | | * 科室名称 |
| | | */ |
| | | private String departmentName; |
| | | /** |
| | | * 职称ID 注册用户固定传0 |
| | | */ |
| | | private Long doctorRankId; |
| | | /** |
| | | * 职称 |
| | | */ |
| | | private String doctorRank; |
| | | /** |
| | | * 医生状态 1正常 0试用(注册用户) |
| | | */ |
| | | @NotNull(message = "医生状态 1正常 0试用不能为空") |
| | | private Boolean doctorState; |
| | | } |
| | |
| | | import com.kidgrow.common.model.*; |
| | | import com.kidgrow.common.service.ISuperService; |
| | | import com.kidgrow.usercenter.model.SysUserExcel; |
| | | import com.kidgrow.usercenter.vo.UserRegVo; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | |
| | | * @return |
| | | */ |
| | | ResultBody findDoctorUserAllData(Long userId); |
| | | |
| | | /** |
| | | * H端用户注册 管理员添加用户 |
| | | * @param userRegVo |
| | | * @return |
| | | */ |
| | | ResultBody doctorUserReg(UserRegVo userRegVo); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.kidgrow.common.constant.CommonConstant; |
| | | import com.kidgrow.common.constant.DictionariesConstants; |
| | | import com.kidgrow.common.constant.SecurityConstants; |
| | | import com.kidgrow.common.context.ClientContextHolder; |
| | | import com.kidgrow.common.lock.DistributedLock; |
| | | import com.kidgrow.common.model.SysMenu; |
| | | import com.kidgrow.common.model.SysRole; |
| | | import com.kidgrow.common.model.SysUser; |
| | | import com.kidgrow.common.model.*; |
| | | import com.kidgrow.common.service.impl.SuperServiceImpl; |
| | | import com.kidgrow.common.utils.DateUtils; |
| | |
| | | import com.kidgrow.usercenter.mapper.SysDoctorMapper; |
| | | import com.kidgrow.usercenter.mapper.SysRoleMenuMapper; |
| | | import com.kidgrow.usercenter.mapper.SysUserMapper; |
| | | import com.kidgrow.usercenter.model.SysRoleUser; |
| | | import com.kidgrow.usercenter.model.SysUserExcel; |
| | | import com.kidgrow.usercenter.model.SysDoctor; |
| | | import com.kidgrow.usercenter.model.*; |
| | | import com.kidgrow.usercenter.service.*; |
| | | import com.kidgrow.usercenter.vo.UserRegVo; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | |
| | | |
| | | @Resource |
| | | private ISysRoleUserService roleUserService; |
| | | |
| | | @Resource |
| | | private ISysDictionariesService sysDictionariesService; |
| | | @Resource |
| | | private SysRoleMenuMapper roleMenuMapper; |
| | | |
| | | @Autowired |
| | | private ISysOrganizationService organizationService; |
| | | @Autowired |
| | | private ISysHospitalService hospitalService; |
| | | @Autowired |
| | | private ISysDepartmentService departmentService; |
| | | @Autowired |
| | | private ISysUserOrgService iSysUserOrgService; |
| | | @Autowired |
| | |
| | | if (StringUtils.isBlank(sysUser.getType())) { |
| | | sysUser.setType(UserType.BACKEND.name()); |
| | | } |
| | | sysUser.setPassword(passwordEncoder.encode(CommonConstant.DEF_USER_PASSWORD)); |
| | | String defaultPassWord=com.kidgrow.common.utils.RandomValueUtils.getRandom(6); |
| | | sysUser.setPassword(passwordEncoder.encode(defaultPassWord)); |
| | | sysUser.setEnabled(Boolean.TRUE); |
| | | } |
| | | String username = sysUser.getUsername(); |
| | |
| | | if (phone == null || "".equals(phone.trim())) { |
| | | return ResultBody.failed("请输入手机号"); |
| | | } |
| | | Map<String, Object> selectMap = new HashMap<>(); |
| | | selectMap.put("mobile", phone); |
| | | List<SysUser> sysUsers = baseMapper.selectByMap(selectMap); |
| | | if(sysUsers.size()>0){ |
| | | if (phoneIsUsed(phone)) { |
| | | return ResultBody.failed("该手机号已经注册"); |
| | | } |
| | | |
| | | Map<String, Object> mapDto=new HashMap(); |
| | | mapDto.put("phone",phone); |
| | | mapDto.put("type",ConstantSMS.REGISTER_SMS); |
| | |
| | | } |
| | | return ResultBody.ok().data(null); |
| | | } |
| | | /** |
| | | * H端用户注册 管理员添加用户 |
| | | * @param userRegVo |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultBody doctorUserReg(UserRegVo userRegVo) { |
| | | //检查手机号是否已经注册 H端登录名和手机号存一样的值 |
| | | if (phoneIsUsed(userRegVo.getMobile())) { |
| | | return ResultBody.failed("该手机号已经注册"); |
| | | } |
| | | //检查判断是注册 还是添加用户,注册用户先走基本数据建设 |
| | | if (StringUtils.isBlank(userRegVo.getHospitalId().toString())) { |
| | | userRegVo.setDoctorState(true); |
| | | //添加医院组织结构数据 |
| | | List<SysOrganization> sysOrganizationList=new ArrayList<SysOrganization>(); |
| | | SysOrganization sysOrganizationHos=new SysOrganization(); |
| | | sysOrganizationHos.setOrgAttr(1); |
| | | sysOrganizationHos.setOrgLevel(1); |
| | | sysOrganizationHos.setOrgName(userRegVo.getHospitalName()); |
| | | sysOrganizationList.add(sysOrganizationHos); |
| | | |
| | | public com.kidgrow.usercenter.model.SysDoctor findDoctorByUserId(Long userId) { |
| | | //添加科室组织数据 |
| | | SysOrganization sysOrganizationDe=new SysOrganization(); |
| | | sysOrganizationDe.setOrgAttr(2); |
| | | sysOrganizationDe.setOrgLevel(2); |
| | | sysOrganizationDe.setOrgName(userRegVo.getDepartmentName()); |
| | | sysOrganizationList.add(sysOrganizationDe); |
| | | //批量写入 |
| | | boolean orgRe= organizationService.saveBatch(sysOrganizationList); |
| | | if (orgRe) { |
| | | //写医院数据 |
| | | SysHospital sysHospital=new SysHospital(); |
| | | sysHospital.setHospitalName(userRegVo.getHospitalName()); |
| | | sysHospital.setOrgId(sysOrganizationHos.getId()); |
| | | sysHospital.setAccountsCount(1); |
| | | sysHospital.setHospitalState(0); |
| | | sysHospital.setCreateUserId(0L); |
| | | sysHospital.setCreateUserName("自主注册"); |
| | | |
| | | boolean h=hospitalService.save(sysHospital); |
| | | if (h) { |
| | | userRegVo.setHospitalId(sysHospital.getId()); |
| | | //保存科室数据 |
| | | SysDepartment sysDepartment=new SysDepartment(); |
| | | sysDepartment.setHospitalId(sysHospital.getId()); |
| | | sysDepartment.setOrgId(sysOrganizationDe.getId()); |
| | | sysDepartment.setDepartmentName(userRegVo.getDepartmentName()); |
| | | sysDepartment.setSaleUserId(0L); |
| | | sysDepartment.setSaleUserName("自主注册"); |
| | | sysDepartment.setSaleUserTel("0"); |
| | | sysDepartment.setServerUserId(0L); |
| | | sysDepartment.setServerUserTel("0"); |
| | | boolean d=departmentService.save(sysDepartment); |
| | | if (!d) { |
| | | return ResultBody.failed("科室数据写入失败"); |
| | | } |
| | | else |
| | | { |
| | | userRegVo.setDepartmentId(sysDepartment.getId()); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return ResultBody.failed("医院数据写入失败"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return ResultBody.failed("组织数据写入失败"); |
| | | } |
| | | } |
| | | //添加用户数据 如果没有输入密码,将会创建一个默认密码返回 |
| | | String defaultPassWord=""; |
| | | SysUser sysUser=new SysUser(); |
| | | sysUser.setUsername(userRegVo.getUsername()); |
| | | sysUser.setMobile(userRegVo.getMobile()); |
| | | if (StringUtils.isBlank(userRegVo.getPassword())) { |
| | | defaultPassWord=com.kidgrow.common.utils.RandomValueUtils.getRandom(6); |
| | | sysUser.setPassword(passwordEncoder.encode(defaultPassWord)); |
| | | sysUser.setDefaultAuth(true); |
| | | userRegVo.setPassword(defaultPassWord); |
| | | } |
| | | else { |
| | | sysUser.setPassword(passwordEncoder.encode(userRegVo.getPassword())); |
| | | sysUser.setDefaultAuth(false); |
| | | } |
| | | sysUser.setNickname(userRegVo.getNickname()); |
| | | sysUser.setSex(userRegVo.getSex()); |
| | | sysUser.setEnabled(true); |
| | | if (StringUtils.isNotBlank(userRegVo.getType())) { |
| | | sysUser.setType(userRegVo.getType()); |
| | | } |
| | | else |
| | | { |
| | | sysUser.setType(UserType.DOCTOR.name()); |
| | | } |
| | | sysUser.setHAdminUser(false); |
| | | sysUser.setOpenId(userRegVo.getOpenId()); |
| | | sysUser.setDel(false); |
| | | boolean u=this.save(sysUser); |
| | | if(u) |
| | | { |
| | | //写入职务数据 |
| | | if (StringUtils.isNotBlank(userRegVo.getDoctorRank())) { |
| | | //检查医生职务是否存在 |
| | | Map<String, Object> selectMap = new HashMap<>(); |
| | | selectMap.put("dictionaries_name", userRegVo.getDoctorRank()); |
| | | List<SysDictionaries> dictionariesList=sysDictionariesService.findAll(selectMap); |
| | | if (dictionariesList.size()>0) { |
| | | for (int i = dictionariesList.size() - 1; i >= 0; i--) { |
| | | if (dictionariesList.get(i).getDictionariesName().equals(userRegVo.getDoctorRank())) { |
| | | userRegVo.setDoctorRankId(dictionariesList.get(i).getId()); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //创建字典数据 |
| | | SysDictionaries sysDictionaries=new SysDictionaries(); |
| | | sysDictionaries.setDictionariesKey(DictionariesConstants.DOCTOR_RANK); |
| | | sysDictionaries.setDictionariesClassId(DictionariesConstants.DOCTOR_RANK_ID.toString()); |
| | | //将名称汉字转为拼音 |
| | | sysDictionaries.setDictionariesKey(""); |
| | | sysDictionaries.setDictionariesName(userRegVo.getDoctorRank()); |
| | | sysDictionaries.setCreateUserId(0L); |
| | | sysDictionaries.setCreateUserName("自动创建"); |
| | | boolean d=sysDictionariesService.save(sysDictionaries); |
| | | if (d) { |
| | | userRegVo.setDoctorRankId(sysDictionaries.getId()); |
| | | } |
| | | } |
| | | } |
| | | //写入医生数据 |
| | | SysDoctor sysDoctor=new SysDoctor(); |
| | | sysDoctor.setUserId(sysUser.getId()); |
| | | sysDoctor.setHospitalId(userRegVo.getHospitalId()); |
| | | sysDoctor.setHospitalName(userRegVo.getHospitalName()); |
| | | sysDoctor.setDepartmentId(userRegVo.getDepartmentId()); |
| | | sysDoctor.setDepartmentName(userRegVo.getDepartmentName()); |
| | | sysDoctor.setDoctorRank(userRegVo.getDoctorRank()); |
| | | sysDoctor.setDoctorRankId(userRegVo.getDoctorRankId()); |
| | | sysDoctor.setCreateUserId(0L); |
| | | sysDoctor.setCreateUserName("自主注册"); |
| | | sysDoctor.setDoctorState(userRegVo.getDoctorState()); |
| | | sysDoctor.setDoctorTel(userRegVo.getMobile()); |
| | | sysDoctor.setDoctorName(userRegVo.getNickname()); |
| | | sysDoctor.setServerUserId(0L); |
| | | sysDoctor.setServerUserName("自主注册"); |
| | | if (sysDoctorMapper.insert(sysDoctor)==1) { |
| | | sysUser.setPassword(userRegVo.getPassword()); |
| | | return ResultBody.ok(200,"注册成功").data(sysUser); |
| | | } |
| | | else |
| | | { |
| | | return ResultBody.failed("医生数据写入失败"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return ResultBody.failed("用户数据写入失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 检查手机号是否已经注册 true存在 false不存在 |
| | | * @param phone |
| | | * @return |
| | | */ |
| | | private boolean phoneIsUsed(String phone) |
| | | { |
| | | Map<String, Object> selectMap = new HashMap<>(); |
| | | selectMap.put("mobile", phone); |
| | | List<SysUser> sysUsers = baseMapper.selectByMap(selectMap); |
| | | return (sysUsers.size()>0); |
| | | } |
| | | /** |
| | | * 检查用户登录名是否已经注册 true存在 false不存在 |
| | | * @param userName |
| | | * @return |
| | | */ |
| | | private boolean userNameIsUsed(String userName) |
| | | { |
| | | Map<String, Object> selectMap = new HashMap<>(); |
| | | selectMap.put("username", userName); |
| | | List<SysUser> sysUsers = baseMapper.selectByMap(selectMap); |
| | | return (sysUsers.size()>0); |
| | | } |
| | | public com.kidgrow.usercenter.model.SysDoctor findDoctorByUserId(Long userId) |
| | | { |
| | | Map<String, Object> doctorMap = new HashMap<>(); |
| | | doctorMap.put("user_id",userId); |
| | | doctorMap.put("enabled",1); |
| | |
| | | } |
| | | return new com.kidgrow.usercenter.model.SysDoctor(); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.kidgrow.usercenter.model.SysUserExcel; |
| | | import com.kidgrow.usercenter.model.SysUserLogs; |
| | | import com.kidgrow.usercenter.service.ISysUserService; |
| | | import com.kidgrow.usercenter.vo.UserRegVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | return appUserService.saveOrUpdateUser(sysUser); |
| | | } |
| | | |
| | | @PostMapping("/users/doctorUserReg") |
| | | @AuditLog(operation = "'注册用户:' + #userRegVo.mobile") |
| | | public ResultBody doctorUserReg(@RequestBody UserRegVo userRegVo) { |
| | | return appUserService.doctorUserReg(userRegVo); |
| | | } |
| | | |
| | | /** |
| | | * 导出excel |
| | | * |
| | |
| | | */ |
| | | String HOSPITAL_QUALIFIED = "HOSPITAL_QUALIFIED"; |
| | | /** |
| | | * 医生职称 |
| | | * 医生职称分类名称 |
| | | */ |
| | | String DOCTOR_RANK = "DOCTOR_RANK"; |
| | | /** |
| | | * 医生职称分类id |
| | | */ |
| | | Long DOCTOR_RANK_ID=1248150699682988034L; |
| | | /** |
| | | * 最高组织ID |
| | | */ |
| | | Long ORG_PARENT_ID=1L; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | |
| | | /** |
| | | * 所属医院ID |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | @NotNull(message = "所属医院ID不能为空") |
| | | private Long hospitalId; |
| | | /** |
| | |
| | | /** |
| | | * 科室ID |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long departmentId; |
| | | /** |
| | | * 科室名称 |
| | |
| | | /** |
| | | * 职称ID |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long doctorRankId; |
| | | /** |
| | | * 职称 |
| | |
| | | /** |
| | | * 销售代表的id |
| | | */ |
| | | private String serverUserId; |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long serverUserId; |
| | | /** |
| | | * 销售代表名称 |
| | | */ |
| | |
| | | /** |
| | | * 泊车管理运营平台用户 |
| | | */ |
| | | PARKING_OPERATE |
| | | PARKING_OPERATE, |
| | | /** |
| | | * 医生 |
| | | */ |
| | | DOCTOR |
| | | |
| | | } |
| | |
| | | success:function(){ |
| | | table.render({ |
| | | elem: '#contract-table-detail', |
| | | url: config.base_server + 'api-opration/productorderdetail', |
| | | url: config.base_server + 'api-opration/productorderrecord', |
| | | method: 'GET', |
| | | where:{'orderId':orderId}, |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | |
| | | <input id="hospitalId" type="hidden" /> |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="diagnostic-table-bar"> |
| | | <a class="layui-btn layui-btn-xs permissions" permissions="diagnostic-get" lay-event="select"">查看报告</a> |
| | | <a class="layui-btn layui-btn-xs permissions" permissions="diagnostic-get" lay-event="select">查看报告</a> |
| | | </script> |
| | | |
| | | <script> |
| | |
| | | // 渲染表格 |
| | | table.render({ |
| | | elem: '#diagnostic-table', |
| | | url: config.base_server + 'api-opration/productorderdetail/alldata', |
| | | url: config.base_server + 'api-opration/productorderrecord/alldata', |
| | | method: 'POST', |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | page: true, |
| | |
| | | var renderTable = function () { |
| | | table.render({ |
| | | elem: '#product-table', |
| | | url: config.base_server + 'api-opration/productorderdetail/group', |
| | | url: config.base_server + 'api-opration/productorderrecord/group', |
| | | method: 'GET', |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | page: true, |
| | |
| | | </div> |
| | | <div class="layui-col-sm2"> |
| | | <input id="hospital-search-value" class="layui-input search-input" type="text" placeholder="按医院名" style="width: 100%;" /> |
| | | <input type="hidden" id="hospitalId" value=""> |
| | | </div> |
| | | <div class="layui-col-sm2"> |
| | |  <button id="product-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button> |
| | |
| | | var renderTable = function () { |
| | | table.render({ |
| | | elem: '#product-table', |
| | | url: config.base_server + 'api-opration/productorderdetail/all', |
| | | url: config.base_server + 'api-opration/productorderrecord/all', |
| | | method: 'GET', |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | page: true, |
| | |
| | | layer.confirm('确定要删除吗?', function (i) { |
| | | layer.close(i); |
| | | layer.load(2); |
| | | admin.req('api-opration/productorderdetail/' + obj.data.id, {}, function (data) { |
| | | admin.req('api-opration/productorderrecord/' + obj.data.id, {}, function (data) { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, { icon: 1, time: 500 }, function () { |
| | | renderTable(); |
| | |
| | | } |
| | | } |
| | | var proName = $('#product-search-value').val(); |
| | | var hospitalName = $('#hospital-search-value').val(); |
| | | table.reload('product-table', { where: { proName: proName,hospitalName: hospitalName,startTime: startTime, endTime: endTime } }); |
| | | var hospitalId = $('#hospitalId').val(); |
| | | table.reload('product-table', { where: { proName: proName,hospitalId: hospitalId,departmentId:'1252408277275664385',startTime: startTime, endTime: endTime } }); |
| | | }); |
| | | |
| | | //比较日期大小 |
| | |
| | | url: config.base_server + 'api-user/syshospital/findByName', |
| | | template_val: '{{d.hospitalName}}',//选择后文本框显示的数据字段 |
| | | template_txt: "<div class='layui-table-cell'>{{d.hospitalName}}</div>",//下拉列表模板 |
| | | onselect: function (resp) { |
| | | $("#hospitalId").val(resp.id); |
| | | } |
| | | }); |
| | | }); |
| | | </script> |
| | |
| | | <!-- user表单弹窗 --> |
| | | <form id="user-form" lay-filter="user-form" class="layui-form model-form"> |
| | | <input name="id" type="hidden"/> |
| | | <input name="type" type="hidden" value="BACKEND"/> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">账号</label> |
| | | <div class="layui-input-block"> |