2 files added
7 files modified
New file |
| | |
| | | package com.kidgrow.oprationcenter.vo; |
| | | |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class ProductEndVo extends Model<ProductEndVo> { |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 套餐id |
| | | */ |
| | | private String Id; |
| | | /** |
| | | * 产品id |
| | | */ |
| | | private String proId; |
| | | /** |
| | | * 套餐生效时间 |
| | | */ |
| | | private String beginTime; |
| | | /** |
| | | * 套餐结束时间 |
| | | */ |
| | | private String endTime; |
| | | /** |
| | | * 产品名称 |
| | | */ |
| | | private String proName; |
| | | /** |
| | | * 读片量 |
| | | */ |
| | | private Integer ailightCount; |
| | | /** |
| | | * 产品类型 0试用 1正式 |
| | | */ |
| | | private Integer proType; |
| | | /** |
| | | * 医院id |
| | | */ |
| | | private String hospitalId; |
| | | /** |
| | | * 医院名称 |
| | | */ |
| | | private String hospitalName; |
| | | /** |
| | | * 科室id |
| | | */ |
| | | private String departmentId; |
| | | /** |
| | | * 科室名称 |
| | | */ |
| | | private String departmentName; |
| | | } |
| | |
| | | import com.kidgrow.oprationcenter.model.ProductOrderDetail; |
| | | import com.kidgrow.oprationcenter.vo.GroupProductDetail; |
| | | import com.kidgrow.oprationcenter.vo.OrderChartVo; |
| | | import com.kidgrow.oprationcenter.vo.ProductEndVo; |
| | | import com.kidgrow.oprationcenter.vo.ProductOrderJoinDetail; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | List<OrderChartVo> proCountChart(); |
| | | |
| | | /** |
| | | * 获取最近即将到期的套餐 |
| | | * @param monthPar 月条件 |
| | | * @param aiCountPar 读片量条件 |
| | | * @return |
| | | */ |
| | | List<ProductEndVo>productEndList(Page<ProductEndVo> page,@Param("monthPar") int monthPar,@Param("aiCountPar") int aiCountPar); |
| | | |
| | | /** |
| | | *获取该科室下的所有的套餐信息 |
| | | *获取该科室下的所有的套餐信息 |
| | | * @param hospitalId |
| | |
| | | * @return |
| | | */ |
| | | PageResult<ProductOrderDetail> departmentProductDetail(Map<String, Object> params); |
| | | /** |
| | | * 获取最近即将到期的套餐 |
| | | * @return |
| | | */ |
| | | PageResult<ProductEndVo>productEndList(Map<String, Object> params); |
| | | } |
| | | |
| | |
| | | return PageResult.<ProductOrderDetail>builder().data(list).code(0).count(page.getTotal()).build(); |
| | | } |
| | | |
| | | @Override |
| | | public PageResult<ProductEndVo> productEndList(Map<String, Object> params) { |
| | | Page<ProductEndVo> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit")); |
| | | List<ProductEndVo> list = |
| | | baseMapper.productEndList(page,MapUtils.getIntValue(params,"monthPar"),MapUtils.getIntValue(params,"aiCountPar")); |
| | | return PageResult.<ProductEndVo>builder().data(list).code(0).count(page.getTotal()).build(); |
| | | } |
| | | |
| | | /** |
| | | * 获取诊断列表 |
| | | * @param params |
| | |
| | | List<GroupProductDetail> list = baseMapper.groupProductDetail(page,params); |
| | | return PageResult.<GroupProductDetail>builder().data(list).code(0).count(page.getTotal()).build(); |
| | | } |
| | | |
| | | /** |
| | | * 根据ProductOrderDetail对象当做查询条件进行查询 |
| | | * @param productOrderDetail |
| | |
| | | ORDER BY |
| | | create_time DESC |
| | | </select> |
| | | |
| | | <select id="productEndList" resultType="com.kidgrow.oprationcenter.vo.ProductEndVo"> |
| | | SELECT |
| | | id, |
| | | pro_id, |
| | | pro_begintime beginTime, |
| | | MIN( T2.pro_endtime ) endTime, |
| | | MIN( T2.ailight_count ) ailight_count, |
| | | pro_type, |
| | | pro_name, |
| | | T2.hospital_id, |
| | | hospital_name, |
| | | T2.department_id, |
| | | department_name |
| | | FROM |
| | | ( |
| | | SELECT |
| | | details.id id, |
| | | details.pro_id, |
| | | details.pro_begintime pro_begintime, |
| | | details.pro_endtime pro_endtime, |
| | | details.ailight_count, |
| | | details.pro_name pro_name, |
| | | details.pro_type pro_type, |
| | | orders.hospital_id hospital_id, |
| | | orders.hospital_name hospital_name, |
| | | orders.department_id department_id, |
| | | orders.department_name department_name |
| | | FROM |
| | | product_order_detail details |
| | | LEFT JOIN product_order orders ON orders.id = details.order_id |
| | | WHERE |
| | | details.is_del = 0 |
| | | AND details.enabled = 1 |
| | | AND orders.is_del = 0 |
| | | AND orders.enabled = 1 |
| | | AND pro_endtime BETWEEN now() AND DATE_ADD(NOW(), INTERVAL ${monthPar} MONTH) |
| | | AND ailight_count BETWEEN 1 AND ${aiCountPar} |
| | | AND pro_type=1 |
| | | ORDER BY |
| | | ailight_count, |
| | | pro_endtime |
| | | ) AS T2 |
| | | GROUP BY |
| | | department_id, |
| | | hospital_id, |
| | | department_name, |
| | | hospital_name, |
| | | id, |
| | | pro_id, |
| | | pro_type, |
| | | pro_name, |
| | | ailight_count, |
| | | pro_endtime, |
| | | pro_begintime |
| | | ORDER BY |
| | | ailight_count, |
| | | pro_endtime, |
| | | department_id |
| | | </select> |
| | | </mapper> |
| | |
| | | } |
| | | return productOrderDetailService.groupList(params); |
| | | } |
| | | |
| | | /** |
| | | * 查询到期列表 |
| | | */ |
| | | @ApiOperation(value = "查询到期列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping("/productEnd") |
| | | public PageResult productEndList(@RequestParam Map<String, Object> params) { |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | return productOrderDetailService.productEndList(params); |
| | | } |
| | | /** |
| | | * 获取医院套餐是否到期和到期时间 |
| | | * data内 isend为true说明套餐到期 |
| | |
| | | log.error(sysUserNew.toString()); |
| | | LoginAppUser loginAppUser = new LoginAppUser(); |
| | | SysUser sysUser = this.baseMapper.selectById(sysUserNew); |
| | | log.error("11111"); |
| | | if (sysUser != null) { |
| | | log.error("22222"); |
| | | BeanUtils.copyProperties(sysUser, loginAppUser); |
| | | //获取用户所属组织机构列表 |
| | | loginAppUser.setDefaultAuth(sysUser.getDefaultAuth()); |
| | | List<SysOrganization> sysOrganizations = organizationService.findListByUserId(sysUser.getId()); |
| | | //设置组织机构集合 |
| | | if (sysOrganizations != null) { |
| | | log.error("33333"); |
| | | loginAppUser.setOrganizations(sysOrganizations); |
| | | } |
| | | List<SysRole> sysRoles = roleUserService.findRolesByUserId(sysUser.getId()); |
| | | // 设置角色 |
| | | loginAppUser.setRoles(sysRoles); |
| | | log.error("444444"); |
| | | if (!CollectionUtils.isEmpty(sysRoles)) { |
| | | log.error("55555"); |
| | | Set<Long> roleIds = sysRoles.parallelStream().map(SuperEntity::getId).collect(Collectors.toSet()); |
| | | List<SysMenu> menus = roleMenuMapper.findMenusByRoleIds(roleIds, CommonConstant.PERMISSION); |
| | | if (!CollectionUtils.isEmpty(menus)) { |
| | | log.error("66666"); |
| | | Set<String> permissions = menus.parallelStream().map(p -> p.getPath()) |
| | | .collect(Collectors.toSet()); |
| | | // 设置权限集合 |
| | | loginAppUser.setPermissions(permissions); |
| | | } |
| | | } |
| | | log.error("777777"); |
| | | //医院信息 |
| | | DoctorUserAll doctorUserAllVo = baseMapper.findDoctorUserAllData(sysUser.getId()); |
| | | if (doctorUserAllVo != null) { |
| | | log.error("88888"); |
| | | loginAppUser.setDoctorUserAllVO(doctorUserAllVo); |
| | | //是否医院管理员 |
| | | loginAppUser.setHAdminUser(doctorUserAllVo.getIsAdminUser()); |
| | | } |
| | | log.error("99999"); |
| | | } |
| | | return loginAppUser; |
| | | } |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3 layui-col-md3"> |
| | | <div class="layui-col-sm2 layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">快到期套餐 |
| | | </div> |
| | | <div class="layui-card-body layuiadmin-card-list"> |
| | | <a href="/#!productEnd"> |
| | | <p class="big-font" id="t_product_end"></p> |
| | | </a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3 layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">用户反馈 |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-sm3 layui-col-md3"> |
| | | <div class="layui-col-sm3 layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header">数据需求 |
| | | </div> |
| | |
| | | admin.req("api-opration/productorderdetail/proCountChart", {}, function (data) { |
| | | if (0 === data.code) { |
| | | return data.data; |
| | | } else { |
| | | return null; |
| | | } |
| | | }, "get"); |
| | | } |
| | | // 加载套餐到期统计数据 |
| | | var loadProEndCountChart = function () { |
| | | admin.req("api-opration/productorderdetail/productEnd", {page: 1,limit: 9999,monthPar: 1 |
| | | ,aiCountPar: 50}, function (data) { |
| | | if (0 === data.code) { |
| | | counts= data.count; |
| | | } else { |
| | | return null; |
| | | } |
| | |
| | | //待审核试用套餐 |
| | | loadOprationChart(0); |
| | | $("#t_product").html(counts); |
| | | //套餐到期 |
| | | loadProEndCountChart(); |
| | | $("#t_product_end").html(counts); |
| | | //用户反馈 |
| | | loadOprationChart(2); |
| | | $("#u_feedback").html(counts); |
New file |
| | |
| | | <div class="layui-card"> |
| | | <div class="layui-card-header"> |
| | | <h2 class="header-title">套餐到期</h2> |
| | | <span class="layui-breadcrumb pull-right"> |
| | | <a href="#!console">首页</a> |
| | | <a><cite>套餐到期</cite></a> |
| | | </span> |
| | | </div> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar"> |
| | | <div class="layui-col-sm10"> |
| | | <div class="layui-col-sm3"> |
| | | 套餐时间剩余:<input type="number" class="layui-input search-input" id="monthPar" value="1" min="1" max="99" style="width: 50px;"/>个月内 |
| | | </div> |
| | | <div class="layui-col-sm2"> |
| | | 读片量剩余:<input type="number" class="layui-input search-input" id="aiCountPar" value="50" min="1" max="999" style="width: 50px;"/> |
| | | </div> |
| | | <div class="layui-col-sm2"> |
| | |  <button id="product-btn-search" class="layui-btn icon-btn"><i class="layui-icon"></i>搜索</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table class="layui-table" id="product-end-table" lay-filter="product-end-table"></table> |
| | | </div> |
| | | </div> |
| | | |
| | | <script> |
| | | layui.use(['table', 'util', 'admin', 'config', 'form'], function () { |
| | | let table = layui.table; |
| | | let util = layui.util; |
| | | let admin = layui.admin; |
| | | let form = layui.form; |
| | | let config = layui.config; |
| | | |
| | | // 渲染表格 |
| | | var renderTable = function () { |
| | | var monthPar = $('#monthPar').val(); |
| | | var aiCountPar = $('#aiCountPar').val(); |
| | | table.render({ |
| | | elem: '#product-end-table', |
| | | url: config.base_server + 'api-opration/productorderdetail/productEnd', |
| | | method: 'GET', |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | page: true, |
| | | where:{ monthPar: monthPar, aiCountPar: aiCountPar }, |
| | | cols: [[ |
| | | { field: 'hospitalName', width: 450, title: '医院名称' }, |
| | | { field: 'departmentName', width: 140, title: '科室名称' }, |
| | | { field: 'proName', width: 200, title: '产品名称' }, |
| | | { field: 'beginTime', width: 120, title: '开始时间',templet:function(d){ |
| | | return new Date(d.beginTime).dateFormat("yyyy/MM/dd"); |
| | | } }, |
| | | { field: 'endTime', width: 120, title: '结束时间',templet:function(d){ |
| | | return new Date(d.endTime).dateFormat("yyyy/MM/dd"); |
| | | } }, |
| | | { field: 'ailightCount', width: 100, title: '剩余读片量' } |
| | | ]], |
| | | done: function (res) { |
| | | permissionsInput(res, config); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 搜索按钮点击事件 |
| | | $('#product-btn-search').click(function () { |
| | | var monthPar = $('#monthPar').val(); |
| | | var aiCountPar = $('#aiCountPar').val(); |
| | | table.reload('product-end-table', { where: { monthPar: monthPar, aiCountPar: aiCountPar } }); |
| | | }); |
| | | renderTable(); |
| | | }); |
| | | </script> |