Merge branch 'dev' of ssh://192.168.2.240:29418/kidgrow-microservices-platform into dev
| | |
| | | * @param DetailList 有效的套餐 |
| | | * @return |
| | | */ |
| | | List<ConsumptionRecord> findDetailList(@Param("p") List<Long> DetailList); |
| | | List<ConsumptionRecord> findDetailList(@Param("DetailList") List<Long> DetailList); |
| | | } |
| | |
| | | * units 是产品名称 |
| | | */ |
| | | List<OrderChartVo> proCountChart(); |
| | | |
| | | /** |
| | | *获取该科室下的所有的套餐信息 |
| | | *获取该科室下的所有的套餐信息 |
| | | * @param hospitalId |
| | | * @param departmentId |
| | | * @return |
| | | */ |
| | | List<ProductOrderDetail> departmentProductDetail(Page<ProductOrderDetail> page,@Param("hospitalId") Long hospitalId,@Param("departmentId") Long departmentId); |
| | | } |
| | |
| | | import com.kidgrow.common.service.ISuperService; |
| | | import com.kidgrow.oprationcenter.model.ProductOrderDetail; |
| | | import com.kidgrow.oprationcenter.vo.*; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * endTime 结束时间 |
| | | * @return |
| | | */ |
| | | List<OrderChartVo> productOrderChart(@Param("p") Map<String, Object> params); |
| | | List<OrderChartVo> productOrderChart(Map<String, Object> params); |
| | | /** |
| | | * 统计产品的使用数量 |
| | | * @return ccount 是数量 |
| | | * units 是产品名称 |
| | | */ |
| | | List<OrderChartVo> proCountChart(); |
| | | /** |
| | | *获取该科室下的所有的套餐信息 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | PageResult<ProductOrderDetail> departmentProductDetail(Map<String, Object> params); |
| | | } |
| | | |
| | |
| | | import com.kidgrow.usercenter.model.SysHospital; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.MapUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.cglib.beans.BeanCopier; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | public List<OrderChartVo> proCountChart() { |
| | | return baseMapper.proCountChart(); |
| | | } |
| | | /** |
| | | *获取该科室下的所有的套餐信息 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageResult<ProductOrderDetail> departmentProductDetail(Map<String, Object> params) { |
| | | Page<ProductOrderDetail> page = new Page<>(MapUtils.getInteger(params, "page"), MapUtils.getInteger(params, "limit")); |
| | | List<ProductOrderDetail> list = |
| | | baseMapper.departmentProductDetail(page, Long.parseLong(params.get("hospitalId").toString()),Long.parseLong(params.get("departmentId").toString())); |
| | | return PageResult.<ProductOrderDetail>builder().data(list).code(0).count(page.getTotal()).build(); |
| | | } |
| | | |
| | | /** |
| | | * 获取诊断列表 |
| | |
| | | //科室私有的数据 |
| | | List<ProductOrderJoinDetail> productOrderJoinDetailsListDep = userProductDetail.getProductOrderJoinDetailsListDep(); |
| | | //本医院可共享的读片总量 |
| | | int shareCount = productOrderJoinDetailListShare.stream().collect(Collectors.summingInt(ProductOrderJoinDetail::getAilightCount)); |
| | | int shareCount = (productOrderJoinDetailListShare.size()>0)? |
| | | productOrderJoinDetailListShare.stream().collect(Collectors.summingInt(ProductOrderJoinDetail::getAilightCount)) |
| | | :0; |
| | | //本科室私有读片总量 |
| | | int depCount = productOrderJoinDetailsListDep.stream().collect(Collectors.summingInt(ProductOrderJoinDetail::getAilightCount)); |
| | | int depCount = (productOrderJoinDetailsListDep.size()>0)? |
| | | productOrderJoinDetailsListDep.stream().collect(Collectors.summingInt(ProductOrderJoinDetail::getAilightCount)) |
| | | :0; |
| | | //可用的总量 |
| | | userAICount = shareCount + depCount; |
| | | |
| | | //共享套餐里面的detailid |
| | | List<Long> shareDetailId = productOrderJoinDetailListShare.stream().map(m -> m.getId()).collect(Collectors.toList()); |
| | | List<Long> shareDetailId = (productOrderJoinDetailListShare.size()>0) |
| | | ?productOrderJoinDetailListShare.stream().map(m -> m.getId()).collect(Collectors.toList()) |
| | | :new ArrayList<>(); |
| | | //私有套餐里面的detailid |
| | | List<Long> depDetailId = productOrderJoinDetailsListDep.stream().map(m -> m.getId()).collect(Collectors.toList()); |
| | | |
| | | List<Long> depDetailId = (productOrderJoinDetailsListDep.size()>0) |
| | | ?productOrderJoinDetailsListDep.stream().map(m -> m.getId()).collect(Collectors.toList()) |
| | | :new ArrayList<>(); |
| | | //获取所有有效的套餐id |
| | | List<Long> nowDetailList=shareDetailId; |
| | | List<Long> nowDetailList=new ArrayList<>(); |
| | | BeanUtils.copyProperties(shareDetailId,nowDetailList); |
| | | nowDetailList.addAll(depDetailId); |
| | | //查询已预扣 未退还 未扣费的数据 |
| | | List<ConsumptionRecord> consumptionRecordList = consumptionRecordMapper.findDetailList(nowDetailList); |
| | | //计算预扣费的总量 |
| | | if (consumptionRecordList.size() > 0) { |
| | | //共享套餐里面预扣费总数 |
| | | int shareConCount = consumptionRecordList.stream().filter(f -> shareDetailId.contains(f.getProOrderDetailId())).collect(Collectors.summingInt(ConsumptionRecord::getConsumptionCount)); |
| | | int shareConCount = (shareDetailId.size()>0)?consumptionRecordList.stream() |
| | | .filter(f -> shareDetailId.contains(f.getProOrderDetailId())) |
| | | .collect(Collectors.summingInt(ConsumptionRecord::getConsumptionCount)):0; |
| | | //私有套餐里面预扣费总数 |
| | | int depConCount = consumptionRecordList.stream().filter(f -> depDetailId.contains(f.getProOrderDetailId())).collect(Collectors.summingInt(ConsumptionRecord::getConsumptionCount)); |
| | | int depConCount = (depDetailId.size()>0)?consumptionRecordList.stream() |
| | | .filter(f -> depDetailId.contains(f.getProOrderDetailId())) |
| | | .collect(Collectors.summingInt(ConsumptionRecord::getConsumptionCount)):0; |
| | | userAICount -= (shareConCount + depConCount); |
| | | } |
| | | } |
| | |
| | | SELECT * FROM `consumption_record` |
| | | where record_type=1 |
| | | and update_time is null |
| | | <where> |
| | | <if test="p!=null and p.size()>0"> |
| | | <if test="DetailList!=null and DetailList.size()>0"> |
| | | and pro_order_detail_id in |
| | | <foreach item="item" index="index" collection="p" open="(" close=")" separator=","> |
| | | <foreach item="item" index="index" collection="DetailList" open="(" close=")" separator=","> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | and pro_order_detail_id in (1,1) |
| | | order by id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | ccount DESC |
| | | LIMIT 10 |
| | | </select> |
| | | <select id="departmentProductDetail" resultType="com.kidgrow.oprationcenter.model.ProductOrderDetail"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | product_order_detail |
| | | WHERE |
| | | order_id IN ( SELECT id FROM product_order WHERE hospital_id = #{hospitalId} AND department_id = #{departmentId} AND is_del = 0 AND enabled = 1 ) |
| | | AND is_del = 0 |
| | | AND enabled = 1 |
| | | ORDER BY |
| | | create_time DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | } |
| | | return productOrderDetailService.all(params); |
| | | } |
| | | /** |
| | | * 列表 |
| | | */ |
| | | @ApiOperation(value = "查询列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "分页起始位置", required = true, dataType = "Integer"), |
| | | @ApiImplicitParam(name = "limit", value = "分页结束位置", required = true, dataType = "Integer") |
| | | }) |
| | | @GetMapping("alldetail") |
| | | public PageResult alldetail(@RequestParam Map<String, Object> params) { |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | return productOrderDetailService.departmentProductDetail(params); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | |
| | | - product_order_record |
| | | ignoreSqls: |
| | | - com.kidgrow.usercenter.mapper.SysRoleMapper.findAll |
| | | - com.kidgrow.oprationcenter.mapper.ConsumptionRecordMapper.findDetailList |
| | | |
| | | |
| | |
| | | </select> --> |
| | |   |
| | | <input id="hosName" class="layui-input search-input" type="text" placeholder="按医院名" />  |
| | | <button id="hospita-btn-search" class="layui-btn icon-btn"><i |
| | | class="layui-icon permissions" permissions="hospital-get"></i>搜索</button>  |
| | | <button id="hospital-btn-add" class="layui-btn icon-btn"><i class="layui-icon permissions" permissions="hospital-save"></i>添加医院/科室</button> |
| | | <button id="hospita-btn-search" class="layui-btn icon-btn"><i class="layui-icon permissions" |
| | | permissions="hospital-get"></i>搜索</button>  |
| | | <button id="hospital-btn-add" class="layui-btn icon-btn"><i class="layui-icon permissions" |
| | | permissions="hospital-save"></i>添加医院/科室</button> |
| | | </div> |
| | | |
| | | <!-- 数据表格 --> |
| | |
| | | |
| | | <!-- 表格操作列 --> |
| | | <script type="text/html" id="businessRecords-table-bar"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="productdetail-List">套餐</a> |
| | | <a class="layui-btn layui-btn-xs permissions" permissions="product-rechage" lay-event="pay">充值</a> |
| | | <!-- <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看详情</a> --> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs permissions" permissions="hospital-save" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs permissions" permissions="hospital-del" lay-event="del">删除科室</a> |
| | | </script> |
| | | <!-- 表格状态列 --> |
| | | <script type="text/html" id="hospital-tpl-state"> |
| | | <input type="checkbox" lay-filter="hospital-tpl-state" value="{{d.hospitalId}}" value2="{{d.departmentId}}" lay-skin="switch" lay-text="启用|禁用" |
| | | {{d.enabled==true?'checked':''}}/> |
| | | <input type="checkbox" lay-filter="hospital-tpl-state" value="{{d.hospitalId}}" value2="{{d.departmentId}}" |
| | | lay-skin="switch" lay-text="启用|禁用" {{d.enabled==true?'checked':''}} /> |
| | | </script> |
| | | <!-- 套餐详情 --> |
| | | <script type="text/html" id="productDetail"> |
| | | <table class="layui-table" id="productDetail-table" lay-filter="productDetail-table"></table> |
| | | </script> |
| | | <script> |
| | | layui.use(['form', 'table', 'laydate', 'util', 'config', 'admin', 'autocomplete', 'area'], function () { |
| | |
| | | elem: '#hospital-table', |
| | | url: config.base_server + 'api-user/syshospital', |
| | | method: 'GET', |
| | | headers: { 'Authorization': 'Bearer ' + config.getToken().access_token }, |
| | | headers: { |
| | | 'Authorization': 'Bearer ' + config.getToken().access_token |
| | | }, |
| | | page: true, |
| | | cols: [[ |
| | | { field: 'hospitalId', width: 180, title: '医院编号', fixed: 'left' }, |
| | | { field: 'hospitalName', width: 250, title: '医院名称', fixed: 'left' }, |
| | | { field: 'departmentName', width: 100, title: '科室/部门', fixed: 'left' }, |
| | | cols: [ |
| | | [{ |
| | | field: 'hospitalId', |
| | | width: 180, |
| | | title: '医院编号', |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | field: 'hospitalArea', width: 360, title: '所在地区', templet: function (d) { |
| | | return ((d.hospitalProvince == null) ? "" : d.hospitalProvince) + " " |
| | | + ((d.hospitalCity == null) ? "" : d.hospitalCity) + " " + |
| | | field: 'hospitalName', |
| | | width: 250, |
| | | title: '医院名称', |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | field: 'departmentName', |
| | | width: 100, |
| | | title: '科室/部门', |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | field: 'hospitalArea', |
| | | width: 250, |
| | | title: '所在地区', |
| | | templet: function (d) { |
| | | return ((d.hospitalProvince == null) ? "" : d.hospitalProvince) + |
| | | " " + |
| | | ((d.hospitalCity == null) ? "" : d.hospitalCity) + " " + |
| | | ((d.hospitalArea == null) ? "" : d.hospitalArea) |
| | | } |
| | | }, |
| | | { field: 'hospitalLink', width: 100, title: '联系人' }, |
| | | { field: 'hospitalTel', width: 150, title: '联系方式' }, |
| | | { |
| | | field: 'hospitalLink', |
| | | width: 100, |
| | | title: '联系人' |
| | | }, |
| | | { |
| | | field: 'hospitalTel', |
| | | width: 150, |
| | | title: '联系方式' |
| | | }, |
| | | // { |
| | | // field: 'enabled', width: 80, title: '状态', templet: function (d) { |
| | | // return d.hospitalState == 0 ? "试用" : "正式" |
| | | // } |
| | | // }, |
| | | { |
| | | field: 'isScreen', width: 80, title: '筛查', templet: function (d) { |
| | | field: 'isScreen', |
| | | width: 80, |
| | | title: '筛查', |
| | | templet: function (d) { |
| | | return d.isScreen ? "是" : "否" |
| | | } |
| | | }, |
| | |
| | | // return d.isScreen?"是":"否" |
| | | // } }, |
| | | |
| | | { field: 'serverUserName', width: 100, title: '服务人员' }, |
| | | { field: 'createTime', width: 150, title: '创建时间', templet:function (d) { |
| | | { |
| | | field: 'serverUserName', |
| | | width: 100, |
| | | title: '服务人员' |
| | | }, |
| | | { |
| | | field: 'createTime', |
| | | width: 150, |
| | | title: '创建时间', |
| | | templet: function (d) { |
| | | return new Date(d.createTime).dateFormat("yyyy-MM-dd hh:mm"); |
| | | } }, |
| | | { field: 'enabled', width: 100, templet: '#hospital-tpl-state', title: '状态' }, |
| | | { field: 'hospitalId', width: 200, align: 'center', toolbar: '#businessRecords-table-bar', title: '操作', fixed: 'right' } |
| | | ]], |
| | | } |
| | | }, |
| | | { |
| | | field: 'enabled', |
| | | width: 80, |
| | | templet: '#hospital-tpl-state', |
| | | title: '状态', |
| | | fixed: 'right' |
| | | }, |
| | | { |
| | | field: 'hospitalId', |
| | | width: 250, |
| | | align: 'center', |
| | | toolbar: '#businessRecords-table-bar', |
| | | title: '操作', |
| | | fixed: 'right' |
| | | } |
| | | ] |
| | | ], |
| | | done:function(res){ |
| | | permissionsInput(res,config); |
| | | } |
| | |
| | | }; |
| | | admin.req('api-user/syshospital/delete', whereModel, function (data) { |
| | | layer.closeAll('loading'); |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }, function () { |
| | | layer.msg(data.msg, { |
| | | icon: 1, |
| | | time: 2000 |
| | | }, function () { |
| | | $('#hospita-btn-search').click(); |
| | | }); |
| | | obj.del(); |
| | | }, 'GET'); |
| | | }); |
| | | } |
| | | else if (layEvent === "edit") { |
| | | } else if (layEvent === "edit") { |
| | | //修改 |
| | | admin.putTempData("t_hospital", data); |
| | | showEditModel("edit"); |
| | | } |
| | | else if(layEvent==="pay") |
| | | { |
| | | } else if (layEvent === "pay") { |
| | | //充值 |
| | | admin.putTempData("t_hospital", data); |
| | | admin.popupCenter({ |
| | |
| | | } |
| | | }); |
| | | } |
| | | else if(layEvent==="productdetail-List") |
| | | { |
| | | productdetailShow(obj); |
| | | } |
| | | }); |
| | | // 搜索按钮点击事件 |
| | | $('#hospita-btn-search').click(function () { |
| | |
| | | var hospitalstate = $('#hospitalstate').val(); |
| | | var hospitalName = $('#hosName').val(); |
| | | |
| | | var hospitalProvince = ($("#province").val() != "") ? $('#province option:selected').text() : ""; |
| | | var hospitalProvince = ($("#province").val() != "") ? $('#province option:selected') |
| | | .text() : ""; |
| | | var hospitalCity = ($("#city").val() != "") ? $('#city option:selected').text() : ""; |
| | | var hospitalArea = ($("#areas").val() != "") ? $('#areas option:selected').text() : ""; |
| | | |
| | |
| | | hospitalCity: hospitalCity, |
| | | hospitalArea: hospitalArea |
| | | }; |
| | | table.reload('hospital-table', { where: whereModel }); |
| | | table.reload('hospital-table', { |
| | | where: whereModel |
| | | }); |
| | | }); |
| | | |
| | | // // 显示编辑弹窗 |
| | |
| | | }, function (data) { |
| | | layer.closeAll('loading'); |
| | | if (data.code == 0) { |
| | | layer.msg(data.msg, { icon: 1, time: 2000 }); |
| | | layer.msg(data.msg, { |
| | | icon: 1, |
| | | time: 2000 |
| | | }); |
| | | } else { |
| | | layer.msg(data.msg, { icon: 2, time: 2000 }); |
| | | layer.msg(data.msg, { |
| | | icon: 2, |
| | | time: 2000 |
| | | }); |
| | | $(obj.elem).prop('checked', !obj.elem.checked); |
| | | form.render('checkbox'); |
| | | } |
| | |
| | | admin.putTempData("t_hospital",""); |
| | | showEditModel(); |
| | | }); |
| | | // 套餐按钮点击事件 |
| | | var productdetailShow=function (obj) { |
| | | var data = obj.data; |
| | | layer.open({ |
| | | type: 1, |
| | | title: data.hospitalName + '-' + data.departmentName + ' 所有套餐', |
| | | area: '1200px', |
| | | offset: '100px', |
| | | content: $('#productDetail').html(), |
| | | success: function () { |
| | | table.render({ |
| | | elem: '#productDetail-table', |
| | | url: config.base_server + |
| | | 'api-opration/productorderdetail/alldetail', |
| | | method: 'GET', |
| | | where: { |
| | | 'hospitalId': data.hospitalId, |
| | | 'departmentId': data.departmentId |
| | | }, |
| | | headers: { |
| | | 'Authorization': 'Bearer ' + config.getToken().access_token |
| | | }, |
| | | page: true, |
| | | limit: 10, |
| | | limits: [5, 10], |
| | | cols: [ |
| | | [{ |
| | | field: 'proName', |
| | | width: 300, |
| | | title: '产品名称' |
| | | }, |
| | | { |
| | | field: 'ailightCount', |
| | | width: 150, |
| | | title: '读片量(剩余)' |
| | | }, |
| | | { |
| | | field: 'recordCount', |
| | | width: 150, |
| | | title: '报告量(剩余)' |
| | | }, |
| | | { |
| | | field: 'isShare', |
| | | width: 100, |
| | | title: '是否共享', |
| | | templet: function (d) { |
| | | if (d.isShare) |
| | | return '共享' |
| | | else |
| | | return '私有' |
| | | } |
| | | }, |
| | | { |
| | | field: 'proBegintime', |
| | | width: 150, |
| | | title: '开始时间', |
| | | templet: function (d) { |
| | | return new Date(d.proBegintime) |
| | | .dateFormat("yyyy/MM/dd"); |
| | | } |
| | | }, |
| | | { |
| | | field: 'proEndtime', |
| | | width: 180, |
| | | title: '结束时间', |
| | | templet: function (d) { |
| | | return new Date(d.proEndtime) |
| | | .dateFormat("yyyy/MM/dd"); |
| | | } |
| | | }, |
| | | { |
| | | field: 'createTime', |
| | | width: 160, |
| | | sort: true, |
| | | title: '创建时间' |
| | | } |
| | | ] |
| | | ] |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | }); |
| | | </script> |