ltkj-admin/src/main/java/com/ltkj/web/controller/lis/LisApiMethod.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ltkj-admin/src/main/java/com/ltkj/web/controller/lis/LisApiMethodService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ltkj-admin/src/main/java/com/ltkj/web/controller/lis/LisController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ltkj-admin/src/main/java/com/ltkj/web/controller/pacs/PacsApiMethodService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ltkj-common/src/main/java/com/ltkj/common/utils/IdUtils.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ltkj-framework/src/main/java/com/ltkj/framework/config/SecurityConfig.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ltkj-framework/src/main/java/com/ltkj/framework/config/WebConfig.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
ltkj-admin/src/main/java/com/ltkj/web/controller/lis/LisApiMethod.java
@@ -11,6 +11,7 @@ import com.ltkj.common.core.domain.AjaxResult; import com.ltkj.common.utils.AgeResult; import com.ltkj.common.utils.DateUtils; import com.ltkj.common.utils.IdUtils; import com.ltkj.hosp.domain.*; import com.ltkj.hosp.hisDto.OutpintestapplyDetailsDto; import com.ltkj.hosp.lisDto.LisSaveSqdxxDto; @@ -55,6 +56,8 @@ private LtkjJfxmgljyxmzdService ltkjJfxmgljyxmzdService; @Autowired private LtkjJyxmzdService jyxmzdService; @Autowired private IdUtils idUtils; /** * 保存检验单申请信息 @@ -80,8 +83,10 @@ LisSaveSqdxxDto lisSaveSqdxxDto = new LisSaveSqdxxDto(); LtkjJyxmzd jyxmzd = getGetYbDm(project); BigDecimal allPrice = new BigDecimal("0"); detailList.stream().filter(item -> Objects.equals(item.getParentProId(), project.getProId())) .forEach(item -> allPrice.add(item.getNowPrice())); for (TbTransition transition : detailList.stream().filter(item -> Objects.equals(item.getParentProId(), project.getProId())) .collect(Collectors.toList())) { allPrice = allPrice.add(transition.getNowPrice()); } if (jyxmzd != null) { ArrayList<LisSaveSqdxxJyxmlistDto> dtos = new ArrayList<>(); AtomicInteger xh = new AtomicInteger(); @@ -89,10 +94,11 @@ .forEach(item -> { LisSaveSqdxxJyxmlistDto dto = new LisSaveSqdxxJyxmlistDto(); dto.setXh(String.valueOf(xh.getAndIncrement())); dto.setJyxm(item.getProName()); TjProject project1 = projectService.getById(item.getProId()); LtkjJyxmzd jyxmzd1 = getGetYbDm(project1); dto.setXmmc(jyxmzd1.getJyxmdm()); if (jyxmzd1 == null) dto.setJyxm(project1.getHisXmbm()); else dto.setJyxm(jyxmzd1.getJyxmdm()); dto.setXmmc(project1.getProName()); dtos.add(dto); OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); @@ -108,8 +114,9 @@ }); String yyyyMMdd = DateFormatUtils.format(tjCustomer.getCusBrithday(), "yyyyMMdd"); String sqdh = "3"+yyyyMMdd.substring(2)+ RandomUtil.randomString(String.valueOf(System.currentTimeMillis()), 3); lisSaveSqdxxDto.setJyxh(sqdh); // String sqdh = "3"+yyyyMMdd.substring(2)+ RandomUtil.randomString(String.valueOf(System.currentTimeMillis()), 3); String jyxh = idUtils.generateID(); lisSaveSqdxxDto.setJyxh(jyxh); lisSaveSqdxxDto.setBah(tjOrder.getCardId()); lisSaveSqdxxDto.setBrxm(tjCustomer.getCusName()); lisSaveSqdxxDto.setBrdm(PinyinUtil.getPinyin(tjCustomer.getCusName())); @@ -131,7 +138,7 @@ lisSaveSqdxxDto.setKsbm("0101"); lisSaveSqdxxDto.setSqys("00029"); lisSaveSqdxxDto.setJyxmlistDtoList(dtos); System.out.println(JSONUtil.toJsonStr(lisSaveSqdxxDto)); log.info("检验申请 ->{}",JSONUtil.toJsonStr(lisSaveSqdxxDto)); // TODO 暂不发出请求 if (!detailsDtos.isEmpty() && false) { AjaxResult ajaxResult = lisApiMethodService.saveSqdxx(lisSaveSqdxxDto); @@ -144,7 +151,7 @@ LtkjJianchajianyanTree tree = new LtkjJianchajianyanTree(); tree.setCardId(tjOrder.getCardId()); tree.setPationid(tjCustomer.getPationId()); tree.setSqdh(sqdh); tree.setSqdh(jyxh); tree.setFyhj(allPrice.toString()); String mxfyxmbm = detail.getMxfyxmbm(); tree.setHisXmdm(mxfyxmbm); @@ -215,7 +222,7 @@ LtkjJfxmgljyxmzd jfxmgljyxmzd = ltkjJfxmgljyxmzdService.getOne(wrapper1); if (jfxmgljyxmzd != null) jyxmdm = jfxmgljyxmzd.getJyxmdm(); } if (StrUtil.isBlank(jyxmdm)) log.error("获取检验项目代码为空 ->{}", project); // if (StrUtil.isBlank(jyxmdm)) log.error("获取检验项目代码为空 ->{}", project); LambdaQueryWrapper<LtkjJyxmzd> wrapper2 = new LambdaQueryWrapper<>(); wrapper2.eq(LtkjJyxmzd::getJyxmdm,jyxmdm); LtkjJyxmzd jyxmzd = jyxmzdService.getOne(wrapper2); ltkj-admin/src/main/java/com/ltkj/web/controller/lis/LisApiMethodService.java
@@ -1,6 +1,7 @@ package com.ltkj.web.controller.lis; import cn.hutool.json.JSONUtil; import com.ltkj.common.core.domain.AjaxResult; import com.ltkj.hosp.lisDto.LisSaveSqdxxDto; import com.ltkj.web.controller.his.HisApiGetMethodService; @@ -111,9 +112,12 @@ map.put("bah", bah); map.put("jyxh", jyxh); map.put("brxm", brxm); log.info("作废检验 ->{}", JSONUtil.toJsonStr(map)); // TODO 暂不请求 return AjaxResult.warn("暂无此数据"); // String post = HttpClientUtils.sendPost(HIS_URL + "/updateSqdxx", map); // return AjaxResult.success().put("data", post); return service.getLisData("updateSqdxx",map); // return service.getLisData("updateSqdxx",map); } ltkj-admin/src/main/java/com/ltkj/web/controller/lis/LisController.java
New file @@ -0,0 +1,61 @@ package com.ltkj.web.controller.lis; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ltkj.common.core.domain.AjaxResult; import com.ltkj.hosp.domain.TbTransition; import com.ltkj.hosp.domain.TjCustomer; import com.ltkj.hosp.domain.TjOrder; import com.ltkj.hosp.service.*; import com.ltkj.system.service.ISysDeptService; import com.ltkj.web.controller.pacs.PacsApiMethodService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.List; /** * @Company: 西安路泰科技有限公司 * @Author: zhaowenxuan * @Date: 2024/10/10 16:59 */ @RestController @RequestMapping("lis") public class LisController { @Autowired private ITbTransitionService tbTransitionService; @Autowired private LisApiMethod lisApiMethod; @Autowired private ITjOrderService orderService; @Autowired private ITjCustomerService customerService; @Autowired private PacsApiMethodService pacsApiMethodService; @PostMapping("test") public AjaxResult test(@RequestBody String json){ JSONObject parseObj = JSONUtil.parseObj(json); String cusId = parseObj.getStr("cusId"); String cardId = parseObj.getStr("cardId"); // 检验保存 List<TbTransition> detailList = tbTransitionService.getTbTransitionListByCusId(cusId,cardId); TjOrder tjOrder = orderService.getOrderByTjNum(detailList.get(0).getTjNum()); LambdaQueryWrapper<TjCustomer> wrapper = new LambdaQueryWrapper<>(); wrapper.eq(TjCustomer::getCusIdcard,cusId); TjCustomer customer = customerService.getOne(wrapper); lisApiMethod.save(tjOrder,customer,detailList); // 检验作废 lisApiMethod.cancel("",tjOrder.getCardId(),customer.getCusName()); // 检查保存 pacsApiMethodService.save(tjOrder,customer,detailList); // 检查作废 pacsApiMethodService.updatePacsApply("","",customer.getCusName()); return AjaxResult.success(); } } ltkj-admin/src/main/java/com/ltkj/web/controller/pacs/PacsApiMethodService.java
@@ -53,7 +53,7 @@ * @param savePacsApply * @return */ public AjaxResult savePacsApply(SavePacsApply savePacsApply){ private AjaxResult savePacsApply(SavePacsApply savePacsApply){ Map<String, Object> map = BeanUtil.beanToMap(savePacsApply); return getMethodService.getPacsData("savePacsApply", map); } @@ -81,7 +81,9 @@ hashMap.put("regNo", regNo); hashMap.put("examNo", examNo); hashMap.put("name", name); return getMethodService.getPacsData("updatePacsApply",hashMap); log.info("作废检查 ->{}",JSONUtil.toJsonStr(hashMap)); // return getMethodService.getPacsData("updatePacsApply",hashMap); return AjaxResult.success(); } public Boolean save(TjOrder tjOrder, TjCustomer tjCustomer,List<TbTransition> detailList) { @@ -112,6 +114,7 @@ savePacsApply.setRegNo(regNo); savePacsApply.setCheckItemID(project.getHisXmbm()); savePacsApply.setCheckItem(project.getHisXmmc()); // TODO 检查部位 savePacsApply.setCheckPosition(""); savePacsApply.setAmount(project.getProPrice()); savePacsApply.setApplyDate(DateFormatUtils.format(date, "yyyy-MM-dd HH:mm:ss")); @@ -122,8 +125,13 @@ savePacsApply.setExecDepment("0101"); savePacsApply.setExecDepmentName("体检中心"); savePacsApply.setCreateTime(savePacsApply.getApplyDate()); // TODO 检查设备 savePacsApply.setDevice(""); // TODO 检查设备类型 savePacsApply.setDeviceType(""); log.info("检查申请 ->{}",JSONUtil.toJsonStr(savePacsApply)); if (true) return false; AjaxResult ajaxResult = savePacsApply(savePacsApply); String result = ajaxResult.get("data").toString(); JSONObject object = JSONUtil.parseObj(JSONUtil.parseObj(result).getStr("Response")); ltkj-common/src/main/java/com/ltkj/common/utils/IdUtils.java
New file @@ -0,0 +1,42 @@ package com.ltkj.common.utils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Component; import java.text.SimpleDateFormat; import java.util.Date; /** * @Company: 西安路泰科技有限公司 * @Author: zhaowenxuan * @Date: 2024/10/10 14:55 */ @Component public class IdUtils { private static final String LIS_LAST_ID_KEY = "id:generate:lis:id"; private static final String LIS_CURRENT_DATE_KEY = "id:generate:lis:currentDate"; @Autowired private StringRedisTemplate stringRedisTemplate; public String generateID() { String currentDate = new SimpleDateFormat("yyyyMMdd").format(new Date()); String storedDate = stringRedisTemplate.opsForValue().get(LIS_CURRENT_DATE_KEY); String lastIdStr = stringRedisTemplate.opsForValue().get(LIS_LAST_ID_KEY); int lastId; if (storedDate == null || !storedDate.equals(currentDate)) { lastId = 1; stringRedisTemplate.opsForValue().set(LIS_LAST_ID_KEY, String.valueOf(lastId)); stringRedisTemplate.opsForValue().set(LIS_CURRENT_DATE_KEY, currentDate); } else { lastId = Integer.parseInt(lastIdStr) + 1; stringRedisTemplate.opsForValue().set(LIS_LAST_ID_KEY, String.valueOf(lastId)); } String yyMMdd = currentDate.substring(2); String id = String.format("%s%06d", yyMMdd, lastId); return id; } } ltkj-framework/src/main/java/com/ltkj/framework/config/SecurityConfig.java
@@ -115,7 +115,7 @@ // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() .antMatchers("/jmreport/**").anonymous() .antMatchers("/jmreport/**","/lis/**").anonymous() // 除上面外的所有请求全部需要鉴权认证 .anyRequest().authenticated() .and() ltkj-framework/src/main/java/com/ltkj/framework/config/WebConfig.java
@@ -20,7 +20,8 @@ "/cus/banner/getBannerList", "/cus/package/getPackageList", "/cus/package/projectListByPacId/**", "/cus/hospital/getHospList" "/cus/hospital/getHospList", "/lis/**" }); } }