From ac1d836efbd5f5c8707ed0bf33b4631025d165c6 Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期一, 29 七月 2024 18:12:27 +0800 Subject: [PATCH] zjh 2024/07/29-1 --- ltkj-system/src/main/java/com/ltkj/system/service/ISysDeptService.java | 7 ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjFlowingWaterController.java | 5 ltkj-common/src/main/java/com/ltkj/common/core/domain/entity/SysDept.java | 1 ltkj-system/src/main/java/com/ltkj/system/service/impl/SysDeptServiceImpl.java | 15 + ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java | 260 +++++++++++++++++++++++-- ltkj-system/src/main/java/com/ltkj/system/mapper/SysDeptMapper.java | 10 + ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java | 156 ++++++++++----- ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java | 9 ltkj-admin/src/main/java/com/ltkj/web/controller/app/CustomerController.java | 119 ++++++----- 9 files changed, 442 insertions(+), 140 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/app/CustomerController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/app/CustomerController.java index ecd0852..d38bd36 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/app/CustomerController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/app/CustomerController.java @@ -43,8 +43,8 @@ * @Date: 2023/1/12 11:08 */ @RestController -@RequestMapping("/cus/hospital") -@Api(tags = "灏忕▼搴�-瀹㈡埛淇℃伅") +@RequestMapping ("/cus/hospital") +@Api (tags = "灏忕▼搴�-瀹㈡埛淇℃伅") public class CustomerController extends BaseController { @Resource @@ -69,8 +69,8 @@ /** * 灏忕▼搴忓氨璇婁汉鍒楄〃 */ - @GetMapping("/getListByOpenId") - @ApiOperation(value = "灏忕▼搴�-灏辫瘖浜哄垪琛�") + @GetMapping ("/getListByOpenId") + @ApiOperation (value = "灏忕▼搴�-灏辫瘖浜哄垪琛�") public AjaxResult getListByOpenId(@RequestParam String openId) { LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>(); wq.eq(TjCustomer::getConnect, openId); @@ -81,9 +81,9 @@ /** * 瑙g粦灏辫瘖浜� */ - @PostMapping("/delCustomer") - @ApiOperation(value = "灏忕▼搴�-瑙g粦灏辫瘖浜�") - public AjaxResult delCustomer(@RequestBody @ApiParam(value = "瀹㈡埛瀵硅薄淇℃伅") TjCustomer tjCustomer) { + @PostMapping ("/delCustomer") + @ApiOperation (value = "灏忕▼搴�-瑙g粦灏辫瘖浜�") + public AjaxResult delCustomer(@RequestBody @ApiParam (value = "瀹㈡埛瀵硅薄淇℃伅") TjCustomer tjCustomer) { if (tjCustomer == null) { return AjaxResult.error(); } @@ -105,11 +105,11 @@ /** * 鏂板骞剁粦瀹氬氨璇婁汉 */ - @PostMapping("/addNew") - @ApiOperation(value = "灏忕▼搴�-鏂板骞剁粦瀹氬氨璇婁汉") + @PostMapping ("/addNew") + @ApiOperation (value = "灏忕▼搴�-鏂板骞剁粦瀹氬氨璇婁汉") @Transactional @RepeatSubmit - public AjaxResult addNew(@RequestBody @ApiParam(value = "瀹㈡埛瀵硅薄淇℃伅") TjCustomer tjCustomer) { + public AjaxResult addNew(@RequestBody @ApiParam (value = "瀹㈡埛瀵硅薄淇℃伅") TjCustomer tjCustomer) { if (tjCustomer == null) { return AjaxResult.error("娣诲姞澶辫触"); } @@ -121,12 +121,12 @@ if (!MatchUtils.isMobileNO(tjCustomer.getCusPhone())) return AjaxResult.error("鎵嬫満鍙烽敊璇�"); - if(cusIdcard.length()==18){ + if (cusIdcard.length() == 18) { if (!MatchUtils.isIdCard(cusIdcard)) { return AjaxResult.error("韬唤璇佸彿鐮侀敊璇�"); } } - if(cusIdcard.length()==9){ + if (cusIdcard.length() == 9) { if (!MatchUtils.cardValidates(cusIdcard)) { return AjaxResult.error("韬唤璇佸彿鐮侀敊璇�"); } @@ -140,15 +140,7 @@ if (customer != null) { customer.setConnect(tjCustomer.getConnect()); - if (customerService.updateById(customer)) { - if(null !=key && key.equals("Y")){ - AjaxResult xinXi = suijieHisXinXi(tjCustomer); - if(!xinXi.get("code").toString().equals("200")){ - TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - return AjaxResult.error("娉ㄥ唽澶辫触,璇峰埌鍓嶅彴鐧昏!" + xinXi.get("msg").toString()); - } - } - } + customerService.updateById(customer); return AjaxResult.success(customer); } String substring = cusIdcard.substring(cusIdcard.length() - 6); @@ -156,7 +148,6 @@ tjCustomer.setCusPassword(substring); tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(cusIdcard), "yyyy-MM-dd")); tjCustomer.setCusSex(Long.valueOf(MatchUtils.getSexByIdCard(cusIdcard))); - //tjCustomer.setAddr(MatchUtils.getNativePlace(Integer.parseInt((cusIdcard)))); tjCustomer.setAge(String.valueOf(MatchUtils.getAgeByIdCard(cusIdcard))); tjCustomer.setIdType("1"); tjCustomer.setAgeUnit("0"); @@ -164,34 +155,35 @@ tjCustomer.setCusIntroduce("鏃�"); tjCustomer.setCusNumber(0L); tjCustomer.setCusIsvip("N"); - if (customerService.save(tjCustomer)) { - if(null !=key && key.equals("Y")){ - AjaxResult xinXi = suijieHisXinXi(tjCustomer); - if(!xinXi.get("code").toString().equals("200")){ - TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - return AjaxResult.error("娉ㄥ唽澶辫触,璇峰埌鍓嶅彴鐧昏!" + xinXi.get("msg").toString()); - } + if (null != key && key.equals("Y")) { + AjaxResult xinXi = suijieHisXinXi(tjCustomer); + if (!xinXi.get("code").toString().equals("200")) { + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return AjaxResult.error("娉ㄥ唽澶辫触,璇峰埌鍓嶅彴鐧昏!" + xinXi.get("msg").toString()); } + } else { + customerService.save(tjCustomer); return AjaxResult.success(tjCustomer); } - return AjaxResult.error("娣诲姞澶辫触"); + + return AjaxResult.success(tjCustomer); } /** * 灏忕▼搴忎綋妫�鎶ュ憡鍒楄〃 */ - @GetMapping("/getReportList") - @ApiOperation(value = "灏忕▼搴�-浣撴鎶ュ憡鍒楄〃") - public AjaxResult getReportList(@RequestParam @ApiParam(value = "鎵嬫満鍙�") String cusPhone) { + @GetMapping ("/getReportList") + @ApiOperation (value = "灏忕▼搴�-浣撴鎶ュ憡鍒楄〃") + public AjaxResult getReportList(@RequestParam @ApiParam (value = "鎵嬫満鍙�") String cusPhone) { return AjaxResult.success(); } /** * 鍥炴樉灏辫瘖浜� */ - @PostMapping("/showCustomer") - @ApiOperation(value = "灏忕▼搴�-鍥炴樉灏辫瘖浜�") - public AjaxResult showCustomer(@RequestBody @ApiParam(value = "瀹㈡埛瀵硅薄淇℃伅") TjCustomer tjCustomer) { + @PostMapping ("/showCustomer") + @ApiOperation (value = "灏忕▼搴�-鍥炴樉灏辫瘖浜�") + public AjaxResult showCustomer(@RequestBody @ApiParam (value = "瀹㈡埛瀵硅薄淇℃伅") TjCustomer tjCustomer) { if (tjCustomer == null) { return AjaxResult.error(); } @@ -206,8 +198,8 @@ /** * 灏忕▼搴忓垽鏂槸鍚﹁兘缂栬緫 */ - @PostMapping("/canUpdate") - @ApiOperation(value = "灏忕▼搴忓垽鏂槸鍚﹁兘缂栬緫") + @PostMapping ("/canUpdate") + @ApiOperation (value = "灏忕▼搴忓垽鏂槸鍚﹁兘缂栬緫") public AjaxResult canUpdate(@RequestBody TjCustomer tjCustomer) { if (tjCustomer == null) { return AjaxResult.error("鍑洪敊浜嗭紝璇疯仈绯诲伐浣滀汉鍛橈紒"); @@ -224,8 +216,8 @@ /** * 灏忕▼搴忕紪杈戝氨璇婁汉淇℃伅 */ - @PostMapping("/updateCustomerBy") - @ApiOperation(value = "灏忕▼搴�-淇敼灏辫瘖浜轰俊鎭�") + @PostMapping ("/updateCustomerBy") + @ApiOperation (value = "灏忕▼搴�-淇敼灏辫瘖浜轰俊鎭�") @Transactional @RepeatSubmit public AjaxResult updateCustomerBy(@RequestBody TjCustomer tjCustomer) { @@ -239,30 +231,33 @@ one.setCusPhone(tjCustomer.getCusPhone()); one.setCusNational(tjCustomer.getCusNational()); one.setCusMarryStatus(tjCustomer.getCusMarryStatus()); - if (customerService.updateById(one)) { - if(null !=key && key.equals("Y")){ - AjaxResult xinXi = suijieHisXinXi(one); - if(!xinXi.get("code").toString().equals("200")){ - TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); - return AjaxResult.error("娣诲姞灏辫瘖浜轰俊鎭け璐�!" + xinXi.get("msg").toString()); - } + + if (null != key && key.equals("Y")) { + AjaxResult xinXi = suijieHisXinXi(one); + if (!xinXi.get("code").toString().equals("200")) { + TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); + return AjaxResult.error("淇敼灏辫瘖浜轰俊鎭け璐�!" + xinXi.get("msg").toString()); } - return AjaxResult.success(one); + } else { + if (!customerService.updateById(one)) { + return AjaxResult.error("淇敼澶辫触"); + } } - return AjaxResult.error("淇敼澶辫触"); + return AjaxResult.success(one); + } /** * 灏忕▼搴忔牴鎹墜鏈哄彿鐮佽幏鍙栫敤鎴疯韩浠借瘉鍙风爜 */ - @GetMapping(value = "/getIdCardByPhone") - @ApiOperation(value = "灏忕▼搴忔牴鎹墜鏈哄彿鐮佽幏鍙栫敤鎴疯韩浠借瘉鍙风爜") - public AjaxResult getIdCardByPhone(@RequestParam @ApiParam(value = "鎵嬫満鍙�") String phone) { + @GetMapping (value = "/getIdCardByPhone") + @ApiOperation (value = "灏忕▼搴忔牴鎹墜鏈哄彿鐮佽幏鍙栫敤鎴疯韩浠借瘉鍙风爜") + public AjaxResult getIdCardByPhone(@RequestParam @ApiParam (value = "鎵嬫満鍙�") String phone) { if (!"".equals(phone) && phone != null && MatchUtils.isMobileNO(phone)) { LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>(); qw.eq(TjCustomer::getCusPhone, phone); List<TjCustomer> tjCustomer1 = customerService.list(qw); - if (tjCustomer1 != null && tjCustomer1.size()>0) { + if (tjCustomer1 != null && tjCustomer1.size() > 0) { List<String> num = new ArrayList<>(); for (TjCustomer tjCustomer : tjCustomer1) { num.add(tjCustomer.getCusIdcard()); @@ -277,7 +272,7 @@ /** * 鏍规嵁瀛楀吀绫诲瀷鏌ヨ瀛楀吀鏁版嵁淇℃伅 */ - @GetMapping(value = "/type/{dictType}") + @GetMapping (value = "/type/{dictType}") public AjaxResult dictType(@PathVariable String dictType) { List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); if (StringUtils.isNull(data)) { @@ -285,7 +280,6 @@ } return success(data); } - //灏嗘柟娉曡繑鍥炲�艰В鏋愭垚json鏍煎紡 @@ -311,10 +305,17 @@ if (null != resultData && resultData.size() > 0) { String pationid = resultData.get("PationId").toString(); if (null != pationid) { - tjCustomer.setPationId(pationid); - customerService.updateById(tjCustomer); + try { + if (tjCustomer.getCusId() == null) { + tjCustomer.setPationId(pationid); + } + customerService.saveOrUpdate(tjCustomer); + } catch (Exception e) { + e.printStackTrace(); + return AjaxResult.error("鎿嶄綔澶辫触!"); + } //淇濆瓨娉ㄥ唽鍏ュ弬鍑哄弬 - resultData.put("cardId",pationid); + resultData.put("cardId", pationid); JSONObject object4 = JSONUtil.parseObj(resultData); LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpincreateapply"); @@ -323,7 +324,7 @@ } } - return AjaxResult.success(); + return AjaxResult.success(tjCustomer); } return AjaxResult.error(object.getStr("ResultContent")); } diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java index d5544f3..9059ca3 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/his/HisApiMethod.java @@ -12,6 +12,7 @@ import com.ltkj.hosp.hisDto.*; import com.ltkj.hosp.service.*; import com.ltkj.system.service.ISysConfigService; +import com.ltkj.system.service.ISysDeptService; import jdk.nashorn.internal.runtime.logging.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -48,7 +49,7 @@ @Autowired private HisApiGetMethodService hisApiGetMethodService; @Resource - private ISysConfigService configService; + private ISysDeptService deptService; @Resource private ITbTransitionService transitionService; @Autowired @@ -189,7 +190,8 @@ LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); wq.in(TjProject::getProId, detailList.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); // wq.groupBy(TjProject::getHisXmbm); - wq.in(TjProject::getDeptId, "241", "317"); +// wq.in(TjProject::getDeptId, "241", "317"); + wq.in(TjProject::getDeptId,deptService.getJyDeptIds()); List<TjProject> projects = projectService.list(wq); if (null != projects && projects.size() > 0) { for (TjProject project : projects) { @@ -291,52 +293,7 @@ } } - //鑽搧鐢宠 - if(outpinmedicapplyDetilsDtos.size()>0){ - OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); - dto1.setHisRegistrationId(cardId); - dto1.setSfzh(customer.getCusIdcard()); - dto1.setSqysbm("00029"); - dto1.setMzksbm("0101"); - dto1.setSjrq(date); - dto1.setCzybm("00029"); - dto1.setCzyksbm("0101"); - dto1.setCflxbm("A"); - dto1.setYfbm("1"); - dto1.setFyts("1"); - dto1.setMzzd(""); - dto1.setDetails(outpinmedicapplyDetilsDtos); - AjaxResult result = controller.Outpinmedicapply(dto1); - String result1 = getAjaxResult(result); - JSONObject object = getJSONObject(result1); - String code = object.getStr("ResultCode"); - if(null !=code && code.equals("200")){ - JSONArray resultData = object.getJSONArray("ResultData"); - Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0); - String cfh = resultDatasss.get("cfh").toString(); - for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { - TjCf cf=new TjCf(); - cf.setCardId(cardId); - cf.setSfzh(customer.getCusIdcard()); - cf.setCfh(cfh); - cf.setSqysbm("00029"); - cf.setSqysxm("鐜嬪仴钀�"); - cf.setMzksbn("0101"); - cf.setSqrq(date); - cf.setCzybm("00029"); - cf.setYpbm(detilsDto.getYpbm()); - cf.setYpmc("灏跨礌[14C]鍛兼皵璇曢獙鑽洅"); - cf.setSl(String.valueOf(detilsDto.getSl())); - cf.setDj(String.valueOf(detilsDto.getDj())); - cf.setDcjl(String.valueOf(detilsDto.getDcjl())); - cf.setPj(String.valueOf(detilsDto.getPj())); - cf.setJj(String.valueOf(detilsDto.getJj())); - cf.setCreateTime(new Date()); - cfService.save(cf); - } - } - } //闂ㄨ瘖妫�鏌ョ敵璇� OutpinexamapplyDto outpinexamapplyDto = new OutpinexamapplyDto(); @@ -353,7 +310,8 @@ LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); wq.in(TjProject::getProId, detailLists.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); // wq.groupBy(TjProject::getHisXmbm); - wq.in(TjProject::getDeptId, "247", "248", "249", "250", "251", "252", "271", "273", "274", "275", "298"); +// wq.in(TjProject::getDeptId, "247", "248", "249", "250", "251", "252", "271", "273", "274", "275", "298"); + wq.in(TjProject::getDeptId,deptService.getJcDeptIds()); List<TjProject> projects = projectService.list(wq); if (null != projects && projects.size() > 0) { for (TjProject project : projects) { @@ -370,7 +328,31 @@ detailsDto.setProjg(project.getProPrice()); detailsDtoss.add(detailsDto); } - + if(project.getProId()==1740177341251154377L){ + OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); + detilsDto.setYpbm("00006670"); + detilsDto.setPcbm("06"); + detilsDto.setSl("1"); + detilsDto.setDj("60"); + detilsDto.setDcjl("1"); + detilsDto.setPj("60"); + detilsDto.setJj("60"); + detilsDto.setJldw(""); + detilsDto.setTjbm(""); + detilsDto.setPs(""); + detilsDto.setPsbm(""); + detilsDto.setYyts(""); + detilsDto.setXtph(""); + detilsDto.setScph(""); + detilsDto.setYpxq(""); + detilsDto.setCdbm(""); + detilsDto.setKfdw(""); + detilsDto.setYfdw(""); + detilsDto.setYysm(""); + detilsDto.setFzbl("1"); + detilsDto.setZh("0"); + outpinmedicapplyDetilsDtos.add(detilsDto); + } } } } @@ -459,7 +441,8 @@ LambdaQueryWrapper<TjProject> wq = new LambdaQueryWrapper<>(); wq.in(TjProject::getProId, details.stream().map(TbTransition::getParentProId).collect(Collectors.toList())); // wq.groupBy(TjProject::getHisXmbm); - wq.in(TjProject::getDeptId, "100", "240", "253", "254", "255", "257", "258", "259", "269", "270"); +// wq.in(TjProject::getDeptId, "100", "240", "253", "254", "255", "257", "258", "259", "269", "270"); + wq.in(TjProject::getDeptId,deptService.getCzDeptIds()); // wq.isNull(TjProject::getDeptId); List<TjProject> projects = projectService.list(wq); if (null != projects && projects.size() > 0) { @@ -476,6 +459,31 @@ detailsDto.setSl(project.getSl()); detailsDto.setProjg(project.getProPrice()); detailDtos.add(detailsDto); + } + if(project.getProId()==1740177341251154377L){ + OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); + detilsDto.setYpbm("00006670"); + detilsDto.setPcbm("06"); + detilsDto.setSl("1"); + detilsDto.setDj("60"); + detilsDto.setDcjl("1"); + detilsDto.setPj("60"); + detilsDto.setJj("60"); + detilsDto.setJldw(""); + detilsDto.setTjbm(""); + detilsDto.setPs(""); + detilsDto.setPsbm(""); + detilsDto.setYyts(""); + detilsDto.setXtph(""); + detilsDto.setScph(""); + detilsDto.setYpxq(""); + detilsDto.setCdbm(""); + detilsDto.setKfdw(""); + detilsDto.setYfdw(""); + detilsDto.setYysm(""); + detilsDto.setFzbl("1"); + detilsDto.setZh("0"); + outpinmedicapplyDetilsDtos.add(detilsDto); } } } @@ -538,6 +546,54 @@ // return AjaxResult.error("澶勭疆鐢宠澶辫触!"); // } } + + //鑽搧鐢宠 + if(outpinmedicapplyDetilsDtos.size()>0){ + OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); + dto1.setHisRegistrationId(cardId); + dto1.setSfzh(customer.getCusIdcard()); + dto1.setSqysbm("00029"); + dto1.setMzksbm("0101"); + dto1.setSjrq(date); + dto1.setCzybm("00029"); + dto1.setCzyksbm("0101"); + dto1.setCflxbm("A"); + dto1.setYfbm("1"); + dto1.setFyts("1"); + dto1.setMzzd(""); + dto1.setDetails(outpinmedicapplyDetilsDtos); + AjaxResult result = controller.Outpinmedicapply(dto1); + String result1 = getAjaxResult(result); + JSONObject object = getJSONObject(result1); + String code = object.getStr("ResultCode"); + if(null !=code && code.equals("200")){ + JSONArray resultData = object.getJSONArray("ResultData"); + Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0); + String cfh = resultDatasss.get("cfh").toString(); + + for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { + TjCf cf=new TjCf(); + cf.setCardId(cardId); + cf.setSfzh(customer.getCusIdcard()); + cf.setCfh(cfh); + cf.setSqysbm("00029"); + cf.setSqysxm("鐜嬪仴钀�"); + cf.setMzksbn("0101"); + cf.setSqrq(date); + cf.setCzybm("00029"); + cf.setYpbm(detilsDto.getYpbm()); + cf.setYpmc("灏跨礌[14C]鍛兼皵璇曢獙鑽洅"); + cf.setSl(String.valueOf(detilsDto.getSl())); + cf.setDj(String.valueOf(detilsDto.getDj())); + cf.setDcjl(String.valueOf(detilsDto.getDcjl())); + cf.setPj(String.valueOf(detilsDto.getPj())); + cf.setJj(String.valueOf(detilsDto.getJj())); + cf.setCreateTime(new Date()); + cfService.save(cf); + } + } + } + return AjaxResult.success(); } diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java index a510ec2..cdbc628 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java @@ -3,6 +3,7 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DateTime; 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; @@ -13,10 +14,7 @@ import com.ltkj.common.utils.StringUtils; import com.ltkj.framework.config.MatchUtils; import com.ltkj.hosp.domain.*; -import com.ltkj.hosp.hisDto.OutpinexamapplyDto; -import com.ltkj.hosp.hisDto.OutpintestapplyDetailsDto; -import com.ltkj.hosp.hisDto.OutpintestapplyDto; -import com.ltkj.hosp.hisDto.OutpintreatapplyDto; +import com.ltkj.hosp.hisDto.*; import com.ltkj.hosp.service.*; import com.ltkj.hosp.vodomain.AddNewReservationConfirm; import com.ltkj.hosp.vodomain.LineChartsVo; @@ -24,6 +22,7 @@ import com.ltkj.hosp.vodomain.QjDomainVo; import com.ltkj.mall.mallOrderUtils.TjConstants; import com.ltkj.system.service.ISysConfigService; +import com.ltkj.system.service.ISysDeptService; import com.ltkj.system.service.ISysUserService; import com.ltkj.web.controller.his.HisApiGetMethodService; import com.ltkj.web.controller.his.HisApiMethodService; @@ -126,6 +125,11 @@ private TjProBlService blService; @Resource private ITjFlowingWaterService tjFlowingWaterService; + @Resource + private ISysDeptService deptService; + @Autowired + private TjCfService cfService; + @Override public void newSaveextracted(TjOrder tjOrder, TjCustomer tjCustomer, BigDecimal discount, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { long l = System.currentTimeMillis(); @@ -530,6 +534,7 @@ //澶勭疆 List<OutpintestapplyDetailsDto> detailDtos = new ArrayList<>(); + List<OutpinmedicapplyDetilsDto> outpinmedicapplyDetilsDtos =new ArrayList<>(); List<TjProject> projectList=new ArrayList<>(); @@ -587,7 +592,8 @@ if(null !=config && config.equals("Y")){ //妫�楠� - if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 241L || project.getDeptId() == 317L)) { +// if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 241L || project.getDeptId() == 317L)) { + if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJyDeptIds().contains(project.getDeptId().toString())) { if (null != project.getHisXmbm()) { OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(project.getHisXmbm()); @@ -599,14 +605,40 @@ detailsDto.setSl(project.getSl()); detailsDtos.add(detailsDto); } + if(project.getProId()==1740177341251154377L){ + OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); + detilsDto.setYpbm("00006670"); + detilsDto.setPcbm("06"); + detilsDto.setSl("1"); + detilsDto.setDj("60"); + detilsDto.setDcjl("1"); + detilsDto.setPj("60"); + detilsDto.setJj("60"); + detilsDto.setJldw(""); + detilsDto.setTjbm(""); + detilsDto.setPs(""); + detilsDto.setPsbm(""); + detilsDto.setYyts(""); + detilsDto.setXtph(""); + detilsDto.setScph(""); + detilsDto.setYpxq(""); + detilsDto.setCdbm(""); + detilsDto.setKfdw(""); + detilsDto.setYfdw(""); + detilsDto.setYysm(""); + detilsDto.setFzbl("1"); + detilsDto.setZh("0"); + outpinmedicapplyDetilsDtos.add(detilsDto); + } } //妫�鏌� - if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && - (project.getDeptId() == 247 || project.getDeptId() == 248 || project.getDeptId() == 249 || - project.getDeptId() == 250 || project.getDeptId() == 251 || project.getDeptId() == 252 || - project.getDeptId() == 271 || project.getDeptId() == 273 || project.getDeptId() == 274 || - project.getDeptId() == 275 || project.getDeptId() == 298)) { +// if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && +// (project.getDeptId() == 247 || project.getDeptId() == 248 || project.getDeptId() == 249 || +// project.getDeptId() == 250 || project.getDeptId() == 251 || project.getDeptId() == 252 || +// project.getDeptId() == 271 || project.getDeptId() == 273 || project.getDeptId() == 274 || +// project.getDeptId() == 275 || project.getDeptId() == 298)) { + if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJcDeptIds().contains(project.getDeptId().toString())) { if (null != project.getHisXmbm()) { OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(project.getHisXmbm()); @@ -618,14 +650,40 @@ detailsDto.setSl(project.getSl()); detailsDtoss.add(detailsDto); } + if(project.getProId()==1740177341251154377L){ + OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); + detilsDto.setYpbm("00006670"); + detilsDto.setPcbm("06"); + detilsDto.setSl("1"); + detilsDto.setDj("60"); + detilsDto.setDcjl("1"); + detilsDto.setPj("60"); + detilsDto.setJj("60"); + detilsDto.setJldw(""); + detilsDto.setTjbm(""); + detilsDto.setPs(""); + detilsDto.setPsbm(""); + detilsDto.setYyts(""); + detilsDto.setXtph(""); + detilsDto.setScph(""); + detilsDto.setYpxq(""); + detilsDto.setCdbm(""); + detilsDto.setKfdw(""); + detilsDto.setYfdw(""); + detilsDto.setYysm(""); + detilsDto.setFzbl("1"); + detilsDto.setZh("0"); + outpinmedicapplyDetilsDtos.add(detilsDto); + } } //澶勭疆 - if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && - (project.getDeptId() == 100 || project.getDeptId() == 240 || project.getDeptId() == 253 || - project.getDeptId() == 254 || project.getDeptId() == 255 || project.getDeptId() == 257 || - project.getDeptId() == 258 || project.getDeptId() == 259 || project.getDeptId() == 269 || - project.getDeptId() == 270)) { +// if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && +// (project.getDeptId() == 100 || project.getDeptId() == 240 || project.getDeptId() == 253 || +// project.getDeptId() == 254 || project.getDeptId() == 255 || project.getDeptId() == 257 || +// project.getDeptId() == 258 || project.getDeptId() == 259 || project.getDeptId() == 269 || +// project.getDeptId() == 270)) { + if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getCzDeptIds().contains(project.getDeptId().toString())) { if (null != project.getHisXmbm()) { OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(project.getHisXmbm()); @@ -637,6 +695,31 @@ detailsDto.setSl(project.getSl()); detailDtos.add(detailsDto); } + if(project.getProId()==1740177341251154377L){ + OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); + detilsDto.setYpbm("00006670"); + detilsDto.setPcbm("06"); + detilsDto.setSl("1"); + detilsDto.setDj("60"); + detilsDto.setDcjl("1"); + detilsDto.setPj("60"); + detilsDto.setJj("60"); + detilsDto.setJldw(""); + detilsDto.setTjbm(""); + detilsDto.setPs(""); + detilsDto.setPsbm(""); + detilsDto.setYyts(""); + detilsDto.setXtph(""); + detilsDto.setScph(""); + detilsDto.setYpxq(""); + detilsDto.setCdbm(""); + detilsDto.setKfdw(""); + detilsDto.setYfdw(""); + detilsDto.setYysm(""); + detilsDto.setFzbl("1"); + detilsDto.setZh("0"); + outpinmedicapplyDetilsDtos.add(detilsDto); + } } } @@ -759,7 +842,8 @@ tjOrderDetailService.save(detail1); if(null !=config && config.equals("Y")){ //妫�楠� - if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 241L || project.getDeptId() == 317L)) { +// if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && (project.getDeptId() == 241L || project.getDeptId() == 317L)) { + if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJyDeptIds().contains(project.getDeptId().toString())) { if (null != project.getHisXmbm()) { OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); @@ -773,14 +857,40 @@ detailsDto.setSl(project.getSl()); detailsDtos.add(detailsDto); } + if(project.getProId()==1740177341251154377L){ + OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); + detilsDto.setYpbm("00006670"); + detilsDto.setPcbm("06"); + detilsDto.setSl("1"); + detilsDto.setDj("60"); + detilsDto.setDcjl("1"); + detilsDto.setPj("60"); + detilsDto.setJj("60"); + detilsDto.setJldw(""); + detilsDto.setTjbm(""); + detilsDto.setPs(""); + detilsDto.setPsbm(""); + detilsDto.setYyts(""); + detilsDto.setXtph(""); + detilsDto.setScph(""); + detilsDto.setYpxq(""); + detilsDto.setCdbm(""); + detilsDto.setKfdw(""); + detilsDto.setYfdw(""); + detilsDto.setYysm(""); + detilsDto.setFzbl("1"); + detilsDto.setZh("0"); + outpinmedicapplyDetilsDtos.add(detilsDto); + } } //妫�鏌� - if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && - (project.getDeptId() == 247L || project.getDeptId() == 248L || project.getDeptId() == 249L || - project.getDeptId() == 250L || project.getDeptId() == 251L || project.getDeptId() == 252L || - project.getDeptId() == 271L || project.getDeptId() == 273L || project.getDeptId() == 274L || - project.getDeptId() == 275L || project.getDeptId() == 298L)) { +// if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && +// (project.getDeptId() == 247L || project.getDeptId() == 248L || project.getDeptId() == 249L || +// project.getDeptId() == 250L || project.getDeptId() == 251L || project.getDeptId() == 252L || +// project.getDeptId() == 271L || project.getDeptId() == 273L || project.getDeptId() == 274L || +// project.getDeptId() == 275L || project.getDeptId() == 298L)) { + if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getJcDeptIds().contains(project.getDeptId().toString())) { if (null != project.getHisXmbm()) { OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(project.getHisXmbm()); @@ -792,14 +902,40 @@ detailsDto.setSl(project.getSl()); detailsDtoss.add(detailsDto); } + if(project.getProId()==1740177341251154377L){ + OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); + detilsDto.setYpbm("00006670"); + detilsDto.setPcbm("06"); + detilsDto.setSl("1"); + detilsDto.setDj("60"); + detilsDto.setDcjl("1"); + detilsDto.setPj("60"); + detilsDto.setJj("60"); + detilsDto.setJldw(""); + detilsDto.setTjbm(""); + detilsDto.setPs(""); + detilsDto.setPsbm(""); + detilsDto.setYyts(""); + detilsDto.setXtph(""); + detilsDto.setScph(""); + detilsDto.setYpxq(""); + detilsDto.setCdbm(""); + detilsDto.setKfdw(""); + detilsDto.setYfdw(""); + detilsDto.setYysm(""); + detilsDto.setFzbl("1"); + detilsDto.setZh("0"); + outpinmedicapplyDetilsDtos.add(detilsDto); + } } //澶勭疆 - if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && - (project.getDeptId() == 100L || project.getDeptId() == 240L || project.getDeptId() == 253L || - project.getDeptId() == 254L || project.getDeptId() == 255L || project.getDeptId() == 257L || - project.getDeptId() == 258L || project.getDeptId() == 259L || project.getDeptId() == 269L || - project.getDeptId() == 270L)) { +// if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && +// (project.getDeptId() == 100L || project.getDeptId() == 240L || project.getDeptId() == 253L || +// project.getDeptId() == 254L || project.getDeptId() == 255L || project.getDeptId() == 257L || +// project.getDeptId() == 258L || project.getDeptId() == 259L || project.getDeptId() == 269L || +// project.getDeptId() == 270L)) { + if (project.getProPrice().compareTo(BigDecimal.ZERO) != 0 && deptService.getCzDeptIds().contains(project.getDeptId().toString())) { if (null != project.getHisXmbm()) { OutpintestapplyDetailsDto detailsDto = new OutpintestapplyDetailsDto(); detailsDto.setMxfyxmbm(project.getHisXmbm()); @@ -811,12 +947,38 @@ detailsDto.setSl(project.getSl()); detailDtos.add(detailsDto); } + if(project.getProId()==1740177341251154377L){ + OutpinmedicapplyDetilsDto detilsDto=new OutpinmedicapplyDetilsDto(); + detilsDto.setYpbm("00006670"); + detilsDto.setPcbm("06"); + detilsDto.setSl("1"); + detilsDto.setDj("60"); + detilsDto.setDcjl("1"); + detilsDto.setPj("60"); + detilsDto.setJj("60"); + detilsDto.setJldw(""); + detilsDto.setTjbm(""); + detilsDto.setPs(""); + detilsDto.setPsbm(""); + detilsDto.setYyts(""); + detilsDto.setXtph(""); + detilsDto.setScph(""); + detilsDto.setYpxq(""); + detilsDto.setCdbm(""); + detilsDto.setKfdw(""); + detilsDto.setYfdw(""); + detilsDto.setYysm(""); + detilsDto.setFzbl("1"); + detilsDto.setZh("0"); + outpinmedicapplyDetilsDtos.add(detilsDto); + } } } } } if(null !=config && config.equals("Y")){ + //妫�楠岀敵璇� @@ -941,6 +1103,52 @@ } } + //鑽搧鐢宠 + if(outpinmedicapplyDetilsDtos.size()>0){ + OutpinmedicapplyDto dto1=new OutpinmedicapplyDto(); + dto1.setHisRegistrationId(order.getCardId()); + dto1.setSfzh(customer.getCusIdcard()); + dto1.setSqysbm("00029"); + dto1.setMzksbm("0101"); + dto1.setSjrq(date); + dto1.setCzybm("00029"); + dto1.setCzyksbm("0101"); + dto1.setCflxbm("A"); + dto1.setYfbm("1"); + dto1.setFyts("1"); + dto1.setMzzd(""); + dto1.setDetails(outpinmedicapplyDetilsDtos); + AjaxResult result = controller.Outpinmedicapply(dto1); + String result1 = getAjaxResult(result); + JSONObject object = getJSONObject(result1); + String code = object.getStr("ResultCode"); + if(null !=code && code.equals("200")){ + JSONArray resultData = object.getJSONArray("ResultData"); + Map<String, Object> resultDatasss = (Map<String, Object>) resultData.get(0); + String cfh = resultDatasss.get("cfh").toString(); + + for (OutpinmedicapplyDetilsDto detilsDto : outpinmedicapplyDetilsDtos) { + TjCf cf=new TjCf(); + cf.setCardId(order.getCardId()); + cf.setSfzh(customer.getCusIdcard()); + cf.setCfh(cfh); + cf.setSqysbm("00029"); + cf.setSqysxm("鐜嬪仴钀�"); + cf.setMzksbn("0101"); + cf.setSqrq(date); + cf.setCzybm("00029"); + cf.setYpbm(detilsDto.getYpbm()); + cf.setYpmc("灏跨礌[14C]鍛兼皵璇曢獙鑽洅"); + cf.setSl(String.valueOf(detilsDto.getSl())); + cf.setDj(String.valueOf(detilsDto.getDj())); + cf.setDcjl(String.valueOf(detilsDto.getDcjl())); + cf.setPj(String.valueOf(detilsDto.getPj())); + cf.setJj(String.valueOf(detilsDto.getJj())); + cf.setCreateTime(new Date()); + cfService.save(cf); + } + } + } //闂ㄨ瘖娌荤枟澶勭疆鐢宠 if(detailDtos.size()>0){ diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java index 1626a30..7d4b702 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java @@ -239,7 +239,7 @@ tjCustomer1.setAgeUnit(tjReservation.getAgeUnit()); tjCustomer1.setCareer(tjReservation.getCareer()); tjCustomer1.setPym(PinyinUtil.getFirstLetter(tjReservation.getName(),"")); - if (null != key && key.equals("Y")) +/* if (null != key && key.equals("Y")) { AjaxResult result = controller.Outpincreateapply(tjCustomer1); String result1 = getAjaxResult(result); @@ -251,7 +251,7 @@ if (null != resultData && resultData.size() > 0) { String pationid = resultData.get("PationId").toString(); if (null != pationid) { - tjCustomer1.setPationId(pationid); +// tjCustomer1.setPationId(pationid); tjCustomerService.updateById(tjCustomer1); //淇濆瓨娉ㄥ唽鍏ュ弬鍑哄弬 resultData.put("cardId",pationid); @@ -265,7 +265,7 @@ } }else { tjCustomerService.updateById(tjCustomer1); - } + }*/ tjCustomer1.setTeamNo(tjReservation.getTeamNo()); tjCustomer1.setCompId(tjReservation.getCompanyId()); tjCustomer1.setReservationId(tjReservation.getId()); @@ -509,7 +509,7 @@ String pationid = resultData.get("PationId").toString(); if (null != pationid) { tjCustomer.setPationId(pationid); - tjCustomerService.updateById(tjCustomer); +// tjCustomerService.updateById(tjCustomer); //淇濆瓨娉ㄥ唽鍏ュ弬鍑哄弬 resultData.put("cardId",pationid); JSONObject object4 = JSONUtil.parseObj(resultData); @@ -556,7 +556,6 @@ if (tjCustomerService.updateById(tjCustomer)) { String config = sysConfigService.selectConfigByKey("sfkqdyhis"); if (null != config && config.equals("Y")) { - tjCustomer.setPationId(customer.getPationId()); AjaxResult result = controller.Outpincreateapply(tjCustomer); String result1 = getAjaxResult(result); JSONObject object = getJSONObject(result1); diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjFlowingWaterController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjFlowingWaterController.java index d8033d2..2feb41c 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjFlowingWaterController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjFlowingWaterController.java @@ -206,6 +206,11 @@ // tjFlowingWater.setTollCollectorId(String.valueOf(SecurityUtils.getLoginUser().getUserId())); // tjFlowingWater.setPayStasus(1L); TjOrder order = orderService.getById(tjFlowingWater.getOrderId()); + + if(order.getFinishTime() !=null){ + return AjaxResult.error("璇ヤ汉鍛樺凡绛剧,涓嶅彲琛ュ綍椤圭洰!"); + } + TjCustomer customer = customerService.getById(order.getUserId()); if (null != tjFlowingWater.getTjProIds() && tjFlowingWater.getTjProIds().length > 0) { tjFlowingWater.setWaterId(PinyinUtil.getFirstLetter(customer.getCusName(), "").toUpperCase() +SecurityUtils.getUsername() + DateUtil.format(new Date(), "yyMMddHHmmssSSS")); diff --git a/ltkj-common/src/main/java/com/ltkj/common/core/domain/entity/SysDept.java b/ltkj-common/src/main/java/com/ltkj/common/core/domain/entity/SysDept.java index 9f1c150..7378c24 100644 --- a/ltkj-common/src/main/java/com/ltkj/common/core/domain/entity/SysDept.java +++ b/ltkj-common/src/main/java/com/ltkj/common/core/domain/entity/SysDept.java @@ -87,6 +87,7 @@ /** * 缁勭粐绫诲瀷锛圥T10.06.17锛� + * 1妫�楠� 2 妫�鏌� 3甯歌澶勭疆 */ private String orgType; diff --git a/ltkj-system/src/main/java/com/ltkj/system/mapper/SysDeptMapper.java b/ltkj-system/src/main/java/com/ltkj/system/mapper/SysDeptMapper.java index 9740b24..61566d0 100644 --- a/ltkj-system/src/main/java/com/ltkj/system/mapper/SysDeptMapper.java +++ b/ltkj-system/src/main/java/com/ltkj/system/mapper/SysDeptMapper.java @@ -145,4 +145,14 @@ List<List<?>> getSysDeptHyAndYxYjWjCustomerList13(Map<String,Object> map); List<ResultSet> getSysDeptYjWjCustomerList2(Map<String,Object> map); + + + @Select("SELECT a.dept_id FROM sys_dept a WHERE a.deleted=0 AND a.`status`=0 AND a.org_type=1") + List<String> getJyDeptIds(); + + @Select("SELECT a.dept_id FROM sys_dept a WHERE a.deleted=0 AND a.`status`=0 AND a.org_type=2") + List<String> getJcDeptIds(); + + @Select("SELECT a.dept_id FROM sys_dept a WHERE a.deleted=0 AND a.`status`=0 AND a.org_type=3") + List<String> getCzDeptIds(); } diff --git a/ltkj-system/src/main/java/com/ltkj/system/service/ISysDeptService.java b/ltkj-system/src/main/java/com/ltkj/system/service/ISysDeptService.java index ad26ac2..099bb5b 100644 --- a/ltkj-system/src/main/java/com/ltkj/system/service/ISysDeptService.java +++ b/ltkj-system/src/main/java/com/ltkj/system/service/ISysDeptService.java @@ -153,4 +153,11 @@ Map<String,Object> getSysDeptHyAndYxYjWjCustomerList13(String deptid, String tjname, String tjNumber, int type, int page , int pageSize); List<TreeSelect> selectDeptList1(SysDept dept); + + + List<String> getJyDeptIds(); + + List<String> getJcDeptIds(); + + List<String> getCzDeptIds(); } diff --git a/ltkj-system/src/main/java/com/ltkj/system/service/impl/SysDeptServiceImpl.java b/ltkj-system/src/main/java/com/ltkj/system/service/impl/SysDeptServiceImpl.java index 37f2ec2..10ec18e 100644 --- a/ltkj-system/src/main/java/com/ltkj/system/service/impl/SysDeptServiceImpl.java +++ b/ltkj-system/src/main/java/com/ltkj/system/service/impl/SysDeptServiceImpl.java @@ -434,4 +434,19 @@ List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList111(dept); return buildDeptTreeSelect(depts); } + + @Override + public List<String> getJyDeptIds() { + return deptMapper.getJyDeptIds(); + } + + @Override + public List<String> getJcDeptIds() { + return deptMapper.getJcDeptIds(); + } + + @Override + public List<String> getCzDeptIds() { + return deptMapper.getCzDeptIds(); + } } -- Gitblit v1.8.0