| | |
| | | package com.ltkj.web.controller.system; |
| | | |
| | | import java.io.*; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.google.common.base.Joiner; |
| | | import com.ltkj.common.core.domain.TreeSelect; |
| | | import com.ltkj.common.core.domain.entity.SysRole; |
| | | import com.ltkj.common.core.domain.entity.SysUser; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.common.core.text.Convert; |
| | | import com.ltkj.common.utils.SecurityUtils; |
| | | import com.ltkj.common.utils.bean.BeanUtils; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.system.domain.SysPost; |
| | | import com.ltkj.system.domain.SysUserPost; |
| | | import com.ltkj.system.service.ISysPostService; |
| | | import com.ltkj.system.service.ISysUserPostService; |
| | | import com.ltkj.system.service.ISysUserService; |
| | | import com.ltkj.system.service.*; |
| | | import com.ltkj.web.controller.his.HisApiGetMethodService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.apache.ibatis.jdbc.Null; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import com.ltkj.common.core.domain.entity.SysDept; |
| | | import com.ltkj.common.enums.BusinessType; |
| | | import com.ltkj.common.utils.StringUtils; |
| | | import com.ltkj.system.service.ISysDeptService; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | @RestController |
| | | @RequestMapping("/system/dept") |
| | | @Api(tags = "科室部门信息") |
| | | @Slf4j |
| | | public class SysDeptController extends BaseController implements Serializable { |
| | | @Resource |
| | | private ISysDeptService deptService; |
| | |
| | | public RedisTemplate<Object,Object> redisTemplate; |
| | | @Resource |
| | | private TestMapper testMapper; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | @Autowired |
| | | private ITjFlowingWaterService tjFlowingWaterService; |
| | | @Autowired |
| | | private HisApiGetMethodService hisApiGetMethodService; |
| | | @Autowired |
| | | private LtkjJianchajianyanTreeService ltkjJianchajianyanTreeService; |
| | | |
| | | /** |
| | | * 该体检科室下客户列表显示接口 |
| | |
| | | .collect(Collectors.toList());*/ |
| | | |
| | | |
| | | List<Long> ksproList = projectService.getYingXiangProId(); |
| | | List<TjCustomer> customerLis = new ArrayList<>(); |
| | | |
| | | //根据体检号查 |
| | | if (null != tjNumber) { |
| | | List<TjOrder> orderList = orderService.getOrderListByLikeTjNum(tjNumber); |
| | | if (null == orderList) { |
| | | return AjaxResult.success("暂时没有数据"); |
| | | } |
| | | for (TjOrder order : orderList) { |
| | | List<TjOrderDetail> list = Optional.ofNullable(detailService.getTjOrderDetailListByOrderId(String.valueOf(order.getOrderId()))).get(); |
| | | if (list.size() == 0) { |
| | | continue; |
| | | } |
| | | LambdaQueryWrapper<TjOrderRemark> wqs = new LambdaQueryWrapper<>(); |
| | | wqs.eq(TjOrderRemark::getTjNumber, order.getTjNumber()); |
| | | wqs.in(TjOrderRemark::getType, 0,3); |
| | | List<TjOrderRemark> lists = remarkService.list(wqs); |
| | | TjCustomer customer = customerService.getById(order.getUserId()); |
| | | //遍历项目 判断是否有重大阳性 标记 |
| | | for (TjOrderDetail tjOrderDetail11 : list) { |
| | | customer.setIsPositive(tjOrderDetail11.getIsPositive()); |
| | | if (tjOrderDetail11.getIsPositive()==1){ |
| | | break; |
| | | } |
| | | } |
| | | customer.setCusName(MatchUtils.hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); |
| | | if (null != lists && lists.size() > 0) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (TjOrderRemark remark : lists) { |
| | | TjProject byId = projectService.selectTjProjectByProId(remark.getProId()); |
| | | TjOrderDetail one = detailService.getTjOrderDetailByOrderId(String.valueOf(order.getOrderId()), String.valueOf(byId.getProId())); |
| | | if (one.getFlowingWaterId() != null) { |
| | | stringBuilder.append(byId.getProName()).append(";"); |
| | | } |
| | | |
| | | } |
| | | customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | customer.setTjStatus(0L); |
| | | } else { |
| | | customer.setTjStatus(1L); |
| | | customer.setNotCheckeds("无"); |
| | | } |
| | | if (order.getTjType().equals("1")) { |
| | | customer.setTjType("团体"); |
| | | } |
| | | if (order.getTjType().equals("2")) { |
| | | customer.setTjType("个人"); |
| | | } |
| | | customer.setTjTime(order.getCreateTime()); |
| | | customer.setTjNumber(order.getTjNumber()); |
| | | customer.setOrderId(order.getOrderId()); |
| | | customer.setIsHz(order.getIsHz()); |
| | | customerLis.add(customer); |
| | | |
| | | } |
| | | if (customerLis.size() > 0) { |
| | | List<TjCustomer> customerList = customerLis.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | Collections.reverse(customerList); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("date", customerList); |
| | | map.put("total", customerLis.size()); |
| | | return AjaxResult.success(map); |
| | | } else { |
| | | return AjaxResult.success("暂无数据"); |
| | | } |
| | | } |
| | | |
| | | //根据姓名查询 |
| | | if (null != name && !"".equals(name)) { |
| | | LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>(); |
| | | wq.like(TjCustomer::getCusName, name); |
| | | List<TjCustomer> list = customerService.list(wq); |
| | | List<TjCustomer> list11111 = new ArrayList<>(); |
| | | if (null != list && list.size() > 0) { |
| | | for (TjCustomer customer : list) { |
| | | customer.setCusName(MatchUtils.hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); |
| | | List<TjOrder> orderList = orderService.getOrderListByCusId(String.valueOf(customer.getCusId())); |
| | | if (null != orderList && orderList.size() > 0) { |
| | | for (TjOrder order : orderList) { |
| | | List<TjOrderDetail> list111 = Optional.ofNullable(detailService.getTjOrderDetailListByOrderId(String.valueOf(order.getOrderId()))).get(); |
| | | if (list111.size() == 0) { |
| | | continue; |
| | | } |
| | | //遍历项目 判断是否有重大阳性 标记 |
| | | for (TjOrderDetail tjOrderDetail11 : list111) { |
| | | customer.setIsPositive(tjOrderDetail11.getIsPositive()); |
| | | if (tjOrderDetail11.getIsPositive()==1){ |
| | | break; |
| | | } |
| | | } |
| | | List<TjOrderRemark> lists = remarkService.getTjOrderRemarkListByYjNum(order.getTjNumber()); |
| | | if (null != lists && lists.size() > 0) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (TjOrderRemark remark : lists) { |
| | | TjProject byId = projectService.selectTjProjectByProId(remark.getProId()); |
| | | TjOrderDetail one = detailService.getTjOrderDetailByOrderId(String.valueOf(order.getOrderId()), String.valueOf(byId.getProId())); |
| | | if (one.getFlowingWaterId() != null) { |
| | | stringBuilder.append(byId.getProName()).append(";"); |
| | | } |
| | | } |
| | | customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | if (null == customer.getNotCheckeds()) customer.setNotCheckeds("全部已检"); |
| | | customer.setTjStatus(0L); |
| | | } else { |
| | | customer.setNotCheckeds("无"); |
| | | customer.setTjStatus(1L); |
| | | } |
| | | if (order.getTjType().equals("1")) { |
| | | customer.setTjType("团体"); |
| | | } |
| | | if (order.getTjType().equals("2")) { |
| | | customer.setTjType("个人"); |
| | | } |
| | | customer.setTjTime(order.getCreateTime()); |
| | | customer.setTjNumber(order.getTjNumber()); |
| | | customer.setOrderId(order.getOrderId()); |
| | | customer.setIsHz(order.getIsHz()); |
| | | list11111.add(customer); |
| | | } |
| | | } |
| | | } |
| | | if (list11111.size() == 0) { |
| | | return AjaxResult.success("暂无数据"); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<TjCustomer> customers = list11111.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | Collections.reverse(customers); |
| | | map.put("customers", customers); |
| | | map.put("total", list11111.size()); |
| | | return AjaxResult.success(map); |
| | | } else { |
| | | return AjaxResult.success("暂无数据"); |
| | | } |
| | | } |
| | | List<TjCustomer> customerLists = null; |
| | | // List<Long> ksproList = projectService.getYingXiangProId(); |
| | | // List<TjCustomer> customerLis = new ArrayList<>(); |
| | | // |
| | | // //根据体检号查 |
| | | // if (null != tjNumber) { |
| | | // List<TjOrder> orderList = orderService.getOrderListByLikeTjNum(tjNumber); |
| | | // if (null == orderList) { |
| | | // return AjaxResult.success("暂时没有数据"); |
| | | // } |
| | | // for (TjOrder order : orderList) { |
| | | // List<TjOrderDetail> list = Optional.ofNullable(detailService.getTjOrderDetailListByOrderId(String.valueOf(order.getOrderId()))).get(); |
| | | // if (list.size() == 0) { |
| | | // continue; |
| | | // } |
| | | // LambdaQueryWrapper<TjOrderRemark> wqs = new LambdaQueryWrapper<>(); |
| | | // wqs.eq(TjOrderRemark::getTjNumber, order.getTjNumber()); |
| | | // wqs.in(TjOrderRemark::getType, 0,3); |
| | | // List<TjOrderRemark> lists = remarkService.list(wqs); |
| | | // TjCustomer customer = customerService.getById(order.getUserId()); |
| | | // //遍历项目 判断是否有重大阳性 标记 |
| | | // for (TjOrderDetail tjOrderDetail11 : list) { |
| | | // customer.setIsPositive(tjOrderDetail11.getIsPositive()); |
| | | // if (tjOrderDetail11.getIsPositive()==1){ |
| | | // break; |
| | | // } |
| | | // } |
| | | // customer.setCusName(MatchUtils.hideCusName(customer.getCusName())); |
| | | // customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | // customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); |
| | | // if (null != lists && lists.size() > 0) { |
| | | // StringBuilder stringBuilder = new StringBuilder(); |
| | | // for (TjOrderRemark remark : lists) { |
| | | // TjProject byId = projectService.selectTjProjectByProId(remark.getProId()); |
| | | // TjOrderDetail one = detailService.getTjOrderDetailByOrderId(String.valueOf(order.getOrderId()), String.valueOf(byId.getProId())); |
| | | // if (one.getFlowingWaterId() != null) { |
| | | // stringBuilder.append(byId.getProName()).append(";"); |
| | | // } |
| | | // |
| | | // } |
| | | // customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | // customer.setTjStatus(0L); |
| | | // } else { |
| | | // customer.setTjStatus(1L); |
| | | // customer.setNotCheckeds("无"); |
| | | // } |
| | | // if (order.getTjType().equals("1")) { |
| | | // customer.setTjType("团体"); |
| | | // } |
| | | // if (order.getTjType().equals("2")) { |
| | | // customer.setTjType("个人"); |
| | | // } |
| | | // customer.setTjTime(order.getCreateTime()); |
| | | // customer.setTjNumber(order.getTjNumber()); |
| | | // customer.setOrderId(order.getOrderId()); |
| | | // customer.setIsHz(order.getIsHz()); |
| | | // customerLis.add(customer); |
| | | // |
| | | // } |
| | | // if (customerLis.size() > 0) { |
| | | // List<TjCustomer> customerList = customerLis.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | // Collections.reverse(customerList); |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // map.put("date", customerList); |
| | | // map.put("total", customerLis.size()); |
| | | // return AjaxResult.success(map); |
| | | // } else { |
| | | // return AjaxResult.success("暂无数据"); |
| | | // } |
| | | // } |
| | | // |
| | | // //根据姓名查询 |
| | | // if (null != name && !"".equals(name)) { |
| | | // LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>(); |
| | | // wq.like(TjCustomer::getCusName, name); |
| | | // List<TjCustomer> list = customerService.list(wq); |
| | | // List<TjCustomer> list11111 = new ArrayList<>(); |
| | | // if (null != list && list.size() > 0) { |
| | | // for (TjCustomer customer : list) { |
| | | // customer.setCusName(MatchUtils.hideCusName(customer.getCusName())); |
| | | // customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | // customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); |
| | | // List<TjOrder> orderList = orderService.getOrderListByCusId(String.valueOf(customer.getCusId())); |
| | | // if (null != orderList && orderList.size() > 0) { |
| | | // for (TjOrder order : orderList) { |
| | | // List<TjOrderDetail> list111 = Optional.ofNullable(detailService.getTjOrderDetailListByOrderId(String.valueOf(order.getOrderId()))).get(); |
| | | // if (list111.size() == 0) { |
| | | // continue; |
| | | // } |
| | | // //遍历项目 判断是否有重大阳性 标记 |
| | | // for (TjOrderDetail tjOrderDetail11 : list111) { |
| | | // customer.setIsPositive(tjOrderDetail11.getIsPositive()); |
| | | // if (tjOrderDetail11.getIsPositive()==1){ |
| | | // break; |
| | | // } |
| | | // } |
| | | // List<TjOrderRemark> lists = remarkService.getTjOrderRemarkListByYjNum(order.getTjNumber()); |
| | | // if (null != lists && lists.size() > 0) { |
| | | // StringBuilder stringBuilder = new StringBuilder(); |
| | | // for (TjOrderRemark remark : lists) { |
| | | // TjProject byId = projectService.selectTjProjectByProId(remark.getProId()); |
| | | // TjOrderDetail one = detailService.getTjOrderDetailByOrderId(String.valueOf(order.getOrderId()), String.valueOf(byId.getProId())); |
| | | // if (one.getFlowingWaterId() != null) { |
| | | // stringBuilder.append(byId.getProName()).append(";"); |
| | | // } |
| | | // } |
| | | // customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | // if (null == customer.getNotCheckeds()) customer.setNotCheckeds("全部已检"); |
| | | // customer.setTjStatus(0L); |
| | | // } else { |
| | | // customer.setNotCheckeds("无"); |
| | | // customer.setTjStatus(1L); |
| | | // } |
| | | // if (order.getTjType().equals("1")) { |
| | | // customer.setTjType("团体"); |
| | | // } |
| | | // if (order.getTjType().equals("2")) { |
| | | // customer.setTjType("个人"); |
| | | // } |
| | | // customer.setTjTime(order.getCreateTime()); |
| | | // customer.setTjNumber(order.getTjNumber()); |
| | | // customer.setOrderId(order.getOrderId()); |
| | | // customer.setIsHz(order.getIsHz()); |
| | | // list11111.add(customer); |
| | | // } |
| | | // } |
| | | // } |
| | | // if (list11111.size() == 0) { |
| | | // return AjaxResult.success("暂无数据"); |
| | | // } |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // List<TjCustomer> customers = list11111.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | // Collections.reverse(customers); |
| | | // map.put("customers", customers); |
| | | // map.put("total", list11111.size()); |
| | | // return AjaxResult.success(map); |
| | | // } else { |
| | | // return AjaxResult.success("暂无数据"); |
| | | // } |
| | | // } |
| | | // List<TjCustomer> customerLists = null; |
| | | Map<String,Object> map=null; |
| | | if (type == 0) { |
| | | // Cursor cursor = redisTemplate.executeWithStickyConnection(redisConnection -> new ConvertingCursor<>(redisConnection.scan(options), redisSerializer::deserialize)); |
| | |
| | | |
| | | String format = DateUtil.format(patbirth, "yyyy.MM.dd"); |
| | | |
| | | List<Map<String, Object>> tjYxjcList = testMapper.getTjYxjcList(patname,sex,patage+patagename,format); |
| | | List<Map<String, Object>> tjYxjcList = testMapper.getTjYxjcList(patname,sex,null); |
| | | return AjaxResult.success(tjYxjcList); |
| | | } |
| | | |
| | |
| | | return toAjax(deptService.insertDept(dept)); |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private IDictHospService dictHospService; |
| | | |
| | | /** |
| | | * 修改科室部门 |
| | | */ |
| | |
| | | return error("该部门包含未停用的子部门!"); |
| | | } |
| | | dept.setUpdateBy(getUsername()); |
| | | |
| | | //查询院区名字赋值 |
| | | if (dept.getHospId()!=null){ |
| | | final DictHosp byId = dictHospService.getById(dept.getHospId()); |
| | | if (byId!=null){ |
| | | dept.setHospName(byId.getHospAreaName()); |
| | | } |
| | | } |
| | | |
| | | |
| | | return toAjax(deptService.updateDept(dept)); |
| | | } |
| | | |
| | |
| | | public AjaxResult addRemark(@ApiParam(value = "体检父项目备注集合") @RequestBody List<TjOrderRemark> remarklList) { |
| | | Long userId = Long.valueOf(SecurityUtils.getLoginUser().getUserId()); |
| | | SysUser sysUser = userService.getById(userId); |
| | | if (remarklList == null || remarklList.size() == 0) { |
| | | if (remarklList == null || remarklList.isEmpty()) { |
| | | return AjaxResult.success("操作失败"); |
| | | } |
| | | for (TjOrderRemark orderRemark : remarklList) { |
| | | List<String> summaryList = orderRemark.getSummaryList(); |
| | | if (null != summaryList && summaryList.size()>0 && !summaryList.contains(null) ) { |
| | | if (null != summaryList && !summaryList.isEmpty() && !summaryList.contains(null) ) { |
| | | orderRemark.setSummary(Joiner.on(";").join(orderRemark.getSummaryList())); |
| | | }else { |
| | | orderRemark.setSummary(null); |
| | | } |
| | | if(StringUtils.isBlank(orderRemark.getRemark()))orderRemark.setRemark(null); |
| | | LambdaQueryWrapper<TjOrder> qw = new LambdaQueryWrapper<>(); |
| | | qw.eq(TjOrder::getTjNumber, orderRemark.getTjNumber()); |
| | | TjOrder order = orderService.getOne(qw); |
| | |
| | | List<TjOrderDetail> tjOrderDetailList = orderRemark.getTjOrderDetailList(); |
| | | |
| | | final TjCustomer byId1 = customerService.getById(order.getUserId()); |
| | | if (null != tjOrderDetailList && tjOrderDetailList.size() > 0) { |
| | | if (null != tjOrderDetailList && !tjOrderDetailList.isEmpty()) { |
| | | //----------------------------------start |
| | | for (TjOrderDetail tjOrderDetail : tjOrderDetailList) { |
| | | final TjProject byId = projectService.getById(tjOrderDetail.getProId()); |
| | |
| | | remarkService.save(remark); |
| | | } else { |
| | | one.setRemark(orderRemark.getRemark()); |
| | | if (null != summaryList && summaryList.size()>0 && !summaryList.contains(null)) { |
| | | if (null != summaryList && !summaryList.isEmpty() && !summaryList.contains(null)) { |
| | | one.setSummary(Joiner.on(";").join(orderRemark.getSummaryList())); |
| | | }else { |
| | | one.setSummary(null); |
| | | } |
| | | one.setDeptId(orderRemark.getDeptId()); |
| | | one.setDoctorName(orderRemark.getDoctorName()); |
| | | one.setType(1); |
| | | remarkService.updateById(one); |
| | |
| | | * @param tjNumber |
| | | * @return |
| | | */ |
| | | // @Transactional |
| | | @GetMapping("/getParentList") |
| | | @ApiOperation(value = "医生点击体检信息详情(只显示父项目列表)") |
| | | public AjaxResult getParentList(@ApiParam(value = "客户体检号") @RequestParam String tjNumber) { |
| | |
| | | } |
| | | ksId = Math.toIntExact(sysUser.getDeptId()); |
| | | } |
| | | String configByKey = configService.selectConfigByKey("sfkqdyhis"); |
| | | // 判断是否收费 请求接口 |
| | | TjOrder tjOrder = orderService.getOrderByTjNum(tjNumber); |
| | | LambdaQueryWrapper<TjFlowingWater> tjFlowingWaterLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | tjFlowingWaterLambdaQueryWrapper.eq(TjFlowingWater::getOrderId,tjOrder.getOrderId()); |
| | | tjFlowingWaterLambdaQueryWrapper.eq(TjFlowingWater::getIsAddition,"N"); |
| | | TjFlowingWater tjFlowingWater = tjFlowingWaterService.getOne(tjFlowingWaterLambdaQueryWrapper); |
| | | if(null !=tjFlowingWater && (tjFlowingWater.getPayStasus()!=1 || tjFlowingWater.getPayStasus()!=3)){ |
| | | if (configByKey.equals("Y")){ |
| | | HashMap<String, Object> hisRequestParams = new HashMap<>(); |
| | | // 不在需要身份证号 |
| | | hisRequestParams.put("patientId",tjOrder.getCardId()); |
| | | log.info("ltkj--- "+DateUtil.date()+"操作人id: "+userId+"操作科室: "+sysUser.getDeptId()+"操作的体检人: "+tjNumber); |
| | | AjaxResult queryPay = hisApiGetMethodService.getHISDataNew("QueryPay", hisRequestParams); |
| | | if (Integer.parseInt(queryPay.get("code").toString()) == 200) { |
| | | int sfsf = ltkjJianchajianyanTreeService.getSfsfByCardId(tjOrder.getCardId()); |
| | | if (sfsf > 0){ |
| | | log.error("路泰科技--- "+DateUtil.date()+" 存在未缴费项目的 就单数 "+sfsf); |
| | | log.error("路泰科技--- "+DateUtil.date()+" 存在未缴费项目的 就诊号 "+tjOrder.getCardId()+" 体检号 "+tjOrder.getTjNumber()); |
| | | return AjaxResult.error("存在未缴费项目"); |
| | | } |
| | | extracted(tjOrder, tjFlowingWater); |
| | | }else { |
| | | log.error("路泰科技--- "+DateUtil.date()+" 未查询到缴费记录的 就诊号 "+tjOrder.getCardId()+" 体检号 "+tjOrder.getTjNumber()); |
| | | return AjaxResult.error("未查询到缴费记录"); |
| | | } |
| | | } |
| | | }else { |
| | | log.error("路泰科技--- "+DateUtil.date()+" 未对接his接口 "+" 体检号 "+tjOrder.getTjNumber()); |
| | | return AjaxResult.error("未查询到缴费记录"); |
| | | } |
| | | String config = configService.selectConfigByKey("qt_open_xdt"); |
| | | String byKey = configService.selectConfigByKey("qt_kjksid"); |
| | | List<Integer> split = new ArrayList<>(); // 存放转换后的integer类型结果 |
| | | if("Y".equals(config)){ |
| | | List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles(); |
| | | if(null !=roles && roles.size()>0){ |
| | | List<SysRole> list = roles.stream().filter(item -> item.getRoleName().contains("前台")).collect(Collectors.toList()); |
| | | if(list.size()>0){ |
| | | if(null !=ksId && ksId==100){ |
| | | ksId=999; |
| | | } |
| | | if(null !=byKey && !"".equals(byKey)){ |
| | | String[] arr = byKey.split(","); // 根据逗号进行切割 |
| | | for (String s : arr) { |
| | | int num = Integer.parseInt(s); // 将每个子字符串转换为integer类型 |
| | | split.add(num); // 添加到列表中 |
| | | } |
| | | } |
| | | }else { |
| | | split.add(ksId); |
| | | } |
| | | }else { |
| | | split.add(ksId); |
| | | } |
| | | }else { |
| | | split.add(ksId); |
| | | } |
| | | |
| | | //判断当前登陆的人是不是管理员。管理员可以看当前体检号下所有项目 |
| | | // if (sysUser.getUserName().equals("10001")) { |
| | | // QueryWrapper<TjOrderRemark> wqq = new QueryWrapper<>(); |
| | |
| | | // } |
| | | LambdaQueryWrapper<TjProject> wq2 = new LambdaQueryWrapper<>(); |
| | | if ((null != sysUser && !sysUser.getUserName().equals("10001")) && 100!=ksId) { |
| | | wq2.eq(TjProject::getDeptId, ksId); |
| | | wq2.in(TjProject::getDeptId,split); |
| | | } |
| | | //判断该项目是否需要打印报告 |
| | | wq2.eq(TjProject::getNeedReport,"Y"); |
| | |
| | | wqq.eq(TjOrderDetail::getOrderId, one.getOrderId()); |
| | | wqq.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | wqq.in(TjOrderDetail::getProId, proIdList); |
| | | wqq.notIn(TjOrderDetail::getProId, proIdList,projectService.getNneedReprotProId()); |
| | | List<TjOrderDetail> detailList = detailService.list(wqq); |
| | | if (detailList != null && detailList.size() > 0) { |
| | | List<Long> collect = detailList.stream().map(TjOrderDetail::getProId).collect(Collectors.toList()); |
| | |
| | | wq.eq("tj_number", tjNumber); |
| | | wq.in("pro_id", collect); |
| | | wq.ne("type", 2); |
| | | wq.ne("dept_id",241); |
| | | wq.notIn("pro_id", proIdList,projectService.getNneedReprotProId()); |
| | | List<TjOrderRemark> list = remarkService.list(wq); |
| | | if (list.size() == 0) { |
| | | return AjaxResult.success("该科室下无项目!"); |
| | |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | @Transactional |
| | | public void extracted(TjOrder tjOrder, TjFlowingWater tjFlowingWater) { |
| | | tjFlowingWater.setPayStasus(1L); |
| | | tjFlowingWater.setPayType(0L); |
| | | tjFlowingWater.setTollCollectorId("148"); |
| | | tjFlowingWaterService.updateById(tjFlowingWater); |
| | | Long tjSerialNumber = tjFlowingWater.getTjSerialNumber(); |
| | | LambdaQueryWrapper<TjOrderDetail> tjOrderDetailLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | tjOrderDetailLambdaQueryWrapper.eq(TjOrderDetail::getOrderId, tjOrder.getOrderId()); |
| | | List<TjOrderDetail> tjOrderDetails = detailService.list(tjOrderDetailLambdaQueryWrapper); |
| | | List<Long> detailIds = tjOrderDetails.stream().map(TjOrderDetail::getOrderDetailId).collect(Collectors.toList()); |
| | | LambdaUpdateWrapper<TjOrderDetail> tjOrderDetailLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
| | | tjOrderDetailLambdaUpdateWrapper.set(TjOrderDetail::getFlowingWaterId,tjSerialNumber); |
| | | tjOrderDetailLambdaUpdateWrapper.in(TjOrderDetail::getOrderDetailId,detailIds); |
| | | detailService.update(tjOrderDetailLambdaUpdateWrapper); |
| | | } |
| | | |
| | | /** |
| | | * 点击父项目显示子项目详情 |
| | | * |
| | |
| | | return AjaxResult.error("获取用户信息错误"); |
| | | } |
| | | |
| | | // if(redisCache.hasHKey("getOrderDetailByProParentId"+tjNumber,proParentId)){ |
| | | // Map<String, Object> mapValue = redisCache.getCacheMapValue("getOrderDetailByProParentId" + tjNumber, proParentId); |
| | | // return AjaxResult.success(mapValue); |
| | | // } |
| | | |
| | | TjOrderRemark remark = remarkService.getTjOrderRemarkByTjNumAndProParentId(tjNumber, proParentId); |
| | | List<TjProject> proParentList = projectService.getTjProjectListBySoneId(proParentId); |
| | | if (null == proParentList || proParentList.size()==0) { |
| | | |
| | | List<TjProject> proParentList = projectService.getTjProjectListByTbTransition(proParentId,tjNumber); |
| | | |
| | | if (null == proParentList || proParentList.isEmpty()) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("xiaoJieIds", null); |
| | | map.put("sons", projectService.list(new LambdaQueryWrapper<TjProject>().eq(TjProject::getProId,proParentId))); |
| | |
| | | return AjaxResult.success("该用户暂时没有体检数据"); |
| | | } |
| | | List<TjOrderDetail> tjOrderDetails = detailService.getTjOrderDetailListInProParentIdList(String.valueOf(one.getOrderId()), proParentIdList); |
| | | List<TjOrderDetail> tjOrderDetailList=new ArrayList<>(); |
| | | TjCustomer customer = tjCustomerService.getById(one.getUserId()); |
| | | if (null != tjOrderDetails && tjOrderDetails.size() > 0) { |
| | | if (null != tjOrderDetails && !tjOrderDetails.isEmpty()) { |
| | | for (TjOrderDetail tjOrderDetail : tjOrderDetails) { |
| | | TjProject project = projectService.getById(tjOrderDetail.getProId()); |
| | | //判断该项目是否需要打印报告 |
| | | if ("N".equals(project.getNeedReport())){ |
| | | continue; |
| | | } |
| | | //病种回显 |
| | | // LambdaQueryWrapper<TjOrderDetailRules> wq=new LambdaQueryWrapper<>(); |
| | | // wq.eq(TjOrderDetailRules::getProId,project.getProId()); |
| | | // wq.eq(TjOrderDetailRules::getTjNumber,tjNumber); |
| | | // List<TjOrderDetailRules> list = tjOrderDetailRulesService.list(wq); |
| | | // List<TjRules> res=new ArrayList<>(); |
| | | // for (TjOrderDetailRules orderDetailRules : list) { |
| | | // final TjRules byId = tjRulesService.getById(orderDetailRules.getAid()); |
| | | // res.add(byId); |
| | | // } |
| | | List<TjRules> rulesList = tjRulesService.getTjRulesListByTjNumAndProId(tjNumber, tjOrderDetail.getProId()); |
| | | tjOrderDetail.setRulesList(rulesList); |
| | | |
| | | //查标准和单位----start |
| | | List<TjStandard> list26 = tjStandardService.getTjStandardListByProId(String.valueOf(tjOrderDetail.getProId())); |
| | | if (list26.size() == 0) { |
| | | project.setProMetering("/"); |
| | | project.setProScope("/"); |
| | | } else if (list26.size() == 1) { |
| | | project.setProMetering(list26.get(0).getCompany() == null ? " " : list26.get(0).getCompany()); |
| | | project.setProScope((list26.get(0).getTjStandardLtValue() == null ? " " : list26.get(0).getTjStandardLtValue()) + "-" + (list26.get(0).getTjStandardGtValue() == null ? " " : list26.get(0).getTjStandardGtValue())); |
| | | } else { |
| | | Long cusSex = customer.getCusSex(); |
| | | Date cusBrithday = customer.getCusBrithday(); |
| | | int age = DateUtil.ageOfNow(cusBrithday); |
| | | for (TjStandard tjStandard : list26) { |
| | | LambdaQueryWrapper<TjStandard> wq8 = new LambdaQueryWrapper<>(); |
| | | if (tjStandard.getTjSex() != null) { |
| | | wq8.eq(TjStandard::getTjSex, cusSex); |
| | | } |
| | | if (tjStandard.getTjType() != null) { |
| | | wq8.eq(TjStandard::getTjType, StringUtils.getAgeType(age)); |
| | | } |
| | | TjStandard standard = tjStandardService.getOne(wq8); |
| | | project.setProMetering(standard.getCompany()); |
| | | project.setProScope((standard.getTjStandardLtValue() == null ? " " : standard.getTjStandardLtValue()) + "-" + (standard.getTjStandardGtValue() == null ? " " : standard.getTjStandardGtValue())); |
| | | } |
| | | } |
| | | //查标准和单位-----end |
| | | tjOrderDetail.setProject(project); |
| | | List<TjStandard> list2 = tjStandardService.getTjStandardListByProId(String.valueOf(project.getProId())); |
| | | if (list2.size() == 0) { |
| | | tjOrderDetail.setStandard(null); |
| | | } else if (list2.size() == 1) { |
| | | tjOrderDetail.setStandard(list2.get(0)); |
| | | } else { |
| | | for (TjStandard tjStandard : list2) { |
| | | LambdaQueryWrapper<TjStandard> wq8 = new LambdaQueryWrapper<>(); |
| | | if (tjStandard.getTjSex() != null) { |
| | | wq8.eq(TjStandard::getTjSex, customer.getCusSex()); |
| | | } |
| | | if (tjStandard.getTjType() != null) { |
| | | wq8.eq(TjStandard::getTjType, StringUtils.getAgeType(DateUtil.ageOfNow(customer.getCusBrithday()))); |
| | | } |
| | | TjStandard standard = tjStandardService.getOne(wq8); |
| | | tjOrderDetail.setStandard(standard); |
| | | } |
| | | } |
| | | if (null != remark.getDoctorName()) { |
| | | //lg0412 |
| | | SysUser byId = userService.getById(remark.getDoctorName()); |
| | | if (byId != null) { |
| | | tjOrderDetail.setDoctorName(userService.getById(remark.getDoctorName()).getNickName()); |
| | |
| | | } else { |
| | | tjOrderDetail.setDoctorName(null); |
| | | } |
| | | tjOrderDetailList.add(tjOrderDetail); |
| | | } |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<TjAdvice> adviceList = new ArrayList<>(); |
| | | if (null != remark) { |
| | | String[] strings = StringUtils.split(remark.getSummary(), ";"); |
| | | // if (null != strings && strings.length > 0) { |
| | | // for (String string : strings) { |
| | | // adviceList.add(tjAdviceService.getById(string)); |
| | | // } |
| | | // } |
| | | if(null !=strings && strings.length>0){ |
| | | List<TjAdvice> list = tjAdviceService.getAdviceStringByIds(strings); |
| | | adviceList.addAll(list); |
| | |
| | | } else { |
| | | map.put("xiaoJieIds", null); |
| | | } |
| | | map.put("sons", tjOrderDetails); |
| | | map.put("sons", tjOrderDetailList); |
| | | map.put("xiaoJie", adviceList); |
| | | map.put("remark", remark.getRemark()); |
| | | |
| | |
| | | /** |
| | | * 根据项目id获取建议 |
| | | */ |
| | | @GetMapping("/getDeptAdvice/{proId}") |
| | | @GetMapping("/getDeptAdvice") |
| | | @ApiOperation(value = "根据项目id获取建议") |
| | | public AjaxResult getDeptAdvice(@ApiParam(value = "父项目项目id") @PathVariable String proId) { |
| | | List<TjAdvice> list = new ArrayList<>(); |
| | | public AjaxResult getDeptAdvice(@ApiParam(value = "父项目项目id") @RequestParam(required = false) String proId, |
| | | @ApiParam(value = "内容") @RequestParam(required = false) String nr, |
| | | @ApiParam(value = "拼音码") @RequestParam(required = false) String pym, |
| | | @ApiParam(value = "页码") @RequestParam(defaultValue ="1") int page, |
| | | @ApiParam(value = "每页展示条数") @RequestParam(defaultValue ="10") int pageSize) { |
| | | LambdaQueryWrapper<TjAdvice> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjAdvice::getProId, proId); |
| | | List<TjAdvice> list1 = tjAdviceService.list(wq1); |
| | | //如果没有项目id 就返回所有的建议集合 |
| | | if (list1.size() == 0) { |
| | | return AjaxResult.success(tjAdviceService.list()); |
| | | if(null !=proId){ |
| | | wq1.eq(TjAdvice::getProId, proId); |
| | | } |
| | | for (TjAdvice tjAdvice : list1) { |
| | | list.add(tjAdvice); |
| | | if(null !=nr && !nr.isEmpty()){ |
| | | wq1.like(TjAdvice::getTitle,nr); |
| | | }else if (null !=pym && !pym.isEmpty()){ |
| | | wq1.like(TjAdvice::getTitle,pym); |
| | | } |
| | | // else { |
| | | // wq1.last("limit 20"); |
| | | // } |
| | | Page<TjAdvice> pages=new Page<>(page,pageSize); |
| | | Page<TjAdvice> advicePage = tjAdviceService.page(pages, wq1); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("list",advicePage.getRecords()); |
| | | map.put("total",advicePage.getTotal()); |
| | | // List<TjAdvice> list = tjAdviceService.list(wq1); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/getAdviceByTjNumAndPro") |
| | | @ApiOperation(value = "根据项目id和体检号获取建议") |
| | | public AjaxResult getAdviceByTjNumAndPro(@ApiParam(value = "父项目项目id") @RequestParam String proId, |
| | | @ApiParam(value = "体检号") @RequestParam String tjNum) { |
| | | LambdaQueryWrapper<TjOrderRemark> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderRemark::getProId, proId); |
| | | wq.eq(TjOrderRemark::getTjNumber,tjNum); |
| | | TjOrderRemark remark = remarkService.getOne(wq); |
| | | List<TjAdvice> list =null; |
| | | if (null != remark && !StringUtils.isBlank(remark.getSummary())) { |
| | | String[] strings = StringUtils.split(remark.getSummary(), ";"); |
| | | if(null !=strings && strings.length>0){ |
| | | list = tjAdviceService.getAdviceStringByIds(strings); |
| | | } |
| | | } |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取部门树列表 |
| | | */ |