增加字典缓存
This commit is contained in:
parent
e6a5f4ad48
commit
636de0d743
@ -43,11 +43,11 @@ public class CacheConstants
|
||||
public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
|
||||
|
||||
/**
|
||||
* lis字典缓存
|
||||
* 字典缓存
|
||||
*/
|
||||
public static final String COM_DICT_KEY = "com_dict:";
|
||||
public static final String REG_DICT_KEY = "reg_dict:";
|
||||
/**
|
||||
* lis设置缓存
|
||||
* 参数
|
||||
*/
|
||||
public static final String COM_OPT_KEY = "com_opt:";
|
||||
|
||||
|
||||
@ -55,4 +55,5 @@ public class RegApply {
|
||||
private String applyid;
|
||||
private String reqDetailName;
|
||||
private String bz;
|
||||
private String slzq;
|
||||
}
|
||||
|
||||
@ -302,6 +302,10 @@ public class RegTransitSample {
|
||||
* 标本退回时间
|
||||
*/
|
||||
private Date BackTime;
|
||||
/**
|
||||
* 生理周期
|
||||
*/
|
||||
private String slzq;
|
||||
|
||||
private String DateType;
|
||||
private Date DateStart;
|
||||
|
||||
@ -1,61 +0,0 @@
|
||||
package com.transitPlatForm.common.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.transitPlatForm.common.constant.CacheConstants;
|
||||
//import com.transitPlatForm.common.core.domain.entity.lis.ComDict;
|
||||
import com.transitPlatForm.common.core.redis.RedisCache;
|
||||
import com.transitPlatForm.common.utils.spring.SpringUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* lis字典工具类
|
||||
*/
|
||||
public class ComDictUtils {
|
||||
|
||||
/**
|
||||
* 设置代码字典缓存
|
||||
*
|
||||
* @param zdlb 字典类别
|
||||
* @param dictDatas 字典数据列表
|
||||
*/
|
||||
// public static void setDictCache(String zdlb, List<ComDict> dictDatas) {
|
||||
// //先清除该key的所有缓存,然后再重新设置该key的缓存
|
||||
// SpringUtils.getBean(RedisCache.class).deleteObject(zdlb);
|
||||
// SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(zdlb), dictDatas);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 清空字典缓存
|
||||
*/
|
||||
public static void clearDictCache() {
|
||||
Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.COM_DICT_KEY + "*");
|
||||
SpringUtils.getBean(RedisCache.class).deleteObject(keys);
|
||||
}
|
||||
/**
|
||||
* 获取字典缓存
|
||||
*
|
||||
* @param zdlb 字典类别
|
||||
* @return dictDatas 字典数据列表
|
||||
*/
|
||||
// public static List<ComDict> getDictCache(String zdlb) {
|
||||
// JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(zdlb));
|
||||
// if (StringUtils.isNotNull(arrayCache)) {
|
||||
// return arrayCache.toList(ComDict.class);
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设置cache key
|
||||
*
|
||||
* @param configKey 参数键
|
||||
* @return 缓存键key
|
||||
*/
|
||||
public static String getCacheKey(String configKey) {
|
||||
return CacheConstants.COM_DICT_KEY + configKey;
|
||||
}
|
||||
}
|
||||
@ -1,90 +0,0 @@
|
||||
package com.transitPlatForm.common.utils;
|
||||
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.transitPlatForm.common.constant.CacheConstants;
|
||||
//import com.transitPlatForm.common.core.domain.entity.lis.ComOpt;
|
||||
import com.transitPlatForm.common.core.redis.RedisCache;
|
||||
import com.transitPlatForm.common.utils.spring.SpringUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class ComOptionUtils {
|
||||
|
||||
/**
|
||||
* 设置参数缓存
|
||||
* 缓存格式:com_opt:HISOPT:SP_INTER com_opt:yq:xxdh
|
||||
* @param yq 仪器
|
||||
* @param xxdh 项目代码
|
||||
* @param comOpt 参数数据
|
||||
*/
|
||||
// public static void setOptCache(String yq,String xxdh, ComOpt comOpt) {
|
||||
// //先清除该key的所有缓存,然后再重新设置该key的缓存
|
||||
// yq=yq.trim();
|
||||
// xxdh=xxdh.toUpperCase();
|
||||
// String key = yq+":"+xxdh;
|
||||
// SpringUtils.getBean(RedisCache.class).deleteObject(key);
|
||||
// SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), comOpt);
|
||||
// }
|
||||
/**
|
||||
* 清空参数缓存
|
||||
*/
|
||||
public static void clearOptCache() {
|
||||
Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.COM_OPT_KEY + "*");
|
||||
SpringUtils.getBean(RedisCache.class).deleteObject(keys);
|
||||
}
|
||||
|
||||
public static void clearOptCache(String yq,String xxdh) {
|
||||
xxdh=xxdh.toUpperCase();
|
||||
yq=yq.trim();
|
||||
Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.COM_OPT_KEY + yq+":"+xxdh);
|
||||
SpringUtils.getBean(RedisCache.class).deleteObject(keys);
|
||||
}
|
||||
/**
|
||||
* 获取参数缓存
|
||||
* 根据现在的参数,获取到的数据应该只有一条
|
||||
* @param yq 仪器
|
||||
* @param xxdh 项目代码
|
||||
* @return ComOpt 参数数据
|
||||
*/
|
||||
// public static ComOpt getOptCache(String yq,String xxdh) {
|
||||
// xxdh=xxdh.toUpperCase();
|
||||
// yq=yq.trim();
|
||||
// String key = yq+":"+xxdh;
|
||||
// Object cacheObject = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
|
||||
// if (StringUtils.isNotNull(cacheObject)) {
|
||||
// return (ComOpt) cacheObject;
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设置cache key
|
||||
*
|
||||
* @param configKey 参数键
|
||||
* @return 缓存键key
|
||||
*/
|
||||
public static String getCacheKey(String configKey) {
|
||||
return CacheConstants.COM_OPT_KEY + configKey;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置参数值域
|
||||
* @param dddwList
|
||||
* @param inputList
|
||||
* @return
|
||||
*/
|
||||
public static String setValueRange(List<String> dddwList,List<String> inputList){
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
map.put("dddwList",dddwList);
|
||||
map.put("inputList",inputList);
|
||||
return JSONUtil.toJsonStr(map);
|
||||
}
|
||||
}
|
||||
@ -4,32 +4,6 @@ package com.transitPlatForm.interfaceCommon.constants;
|
||||
* 系统日志
|
||||
*/
|
||||
public class SysLogConstants {
|
||||
public static final String FEEITEMCLASS_LOG = "条码类别";
|
||||
public static final String FEEITEMVSCLASS_LOG = "条码类别与项目对照";
|
||||
public static final String MZCX_LOG = "门诊采血";
|
||||
public static final String RPTGETRULE_LOG = "报告领取规则";
|
||||
public static final String XMFEE_LOG = "收费项目维护";
|
||||
public static final String DICT_LOG = "常见字典";
|
||||
public static final String INSTR_LOG = "仪器维护";
|
||||
public static final String REPORTITEM_LOG = "检验项目";
|
||||
public static final String XMFILTER_LOG = "光片波长对照表";
|
||||
public static final String XMLOT_LOG = "试剂维护";
|
||||
public static final String XMALARMDETAIL_LOG = "危急值特定判断条件";
|
||||
public static final String XMBASE_LOG = "报告项目";
|
||||
public static final String XMFEEINSTR_LOG = "仪器收费项目对照";
|
||||
public static final String XMREQITEMVSREPORTITEM_LOG = "收费项目报告项目";
|
||||
public static final String LISWORK_LOG = "主界面";
|
||||
public static final String COMOPT_LOG = "后台参数";
|
||||
public static final String LABINPUTMDL_LOG = "项目模板";
|
||||
public static final String LABINSTRVSREQCLASS_LOG = "仪器条码类别对照";
|
||||
public static final String LABTATCTRL_LOG = "TAT设定";
|
||||
public static final String XMCOMP_LOG = "项目组合";
|
||||
public static final String XMMED_LOG = "常用抗生素";
|
||||
public static final String XMMEDGROUP_LOG = "常用抗生素组";
|
||||
public static final String XMMEDINSTR_LOG = "抗生素通道号设定";
|
||||
public static final String XMMEDMAIN_LOG = "细菌抗生素组对照";
|
||||
public static final String XMKNOWLEDGE_LOG = "知识库";
|
||||
public static final String LABCHECKRULES_LOG = "高级审核条件";
|
||||
public static final String QCRULES_LOG = "质控设置";
|
||||
public static final String REQINPUT = "科内开单";
|
||||
public static final String REQINPUT = "自助开单";
|
||||
public static final String DICT = "字典管理";
|
||||
}
|
||||
|
||||
@ -0,0 +1,67 @@
|
||||
package com.transitPlatForm.interfaceCommon.utils.cache;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.transitPlatForm.common.constant.CacheConstants;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegDict;
|
||||
import com.transitPlatForm.common.core.redis.RedisCache;
|
||||
import com.transitPlatForm.common.utils.StringUtils;
|
||||
import com.transitPlatForm.common.utils.spring.SpringUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class RegDictCache {
|
||||
|
||||
/**
|
||||
* 设置字典缓存
|
||||
*
|
||||
* @param key 参数键
|
||||
* @param regDictList 字典数据列表
|
||||
*/
|
||||
public static void setDictCache(String key, List<RegDict> regDictList) {
|
||||
SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), regDictList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置cache key
|
||||
*
|
||||
* @param configKey 参数键
|
||||
* @return 缓存键key
|
||||
*/
|
||||
public static String getCacheKey(String configKey) {
|
||||
return CacheConstants.REG_DICT_KEY + configKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典缓存
|
||||
*
|
||||
* @param key 参数键
|
||||
* @return dictDatas 字典数据列表
|
||||
*/
|
||||
public static List<RegDict> getDictCache(String key) {
|
||||
JSONArray arrayCache = SpringUtils.getBean(RedisCache.class).getCacheObject(getCacheKey(key));
|
||||
if (StringUtils.isNotNull(arrayCache)) {
|
||||
return arrayCache.toList(RegDict.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定字典缓存
|
||||
*
|
||||
* @param key 字典键
|
||||
*/
|
||||
public static void removeDictCache(String key) {
|
||||
SpringUtils.getBean(RedisCache.class).deleteObject(getCacheKey(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空字典缓存
|
||||
*/
|
||||
public static void clearDictCache() {
|
||||
Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.REG_DICT_KEY + "*");
|
||||
SpringUtils.getBean(RedisCache.class).deleteObject(keys);
|
||||
}
|
||||
|
||||
}
|
||||
@ -44,6 +44,7 @@
|
||||
<if test="Status != null and Status !=''">Status,</if>
|
||||
<if test="reqDetailName != null and reqDetailName !=''">reqDetailName,</if>
|
||||
<if test="bz != null and bz !=''">bz,</if>
|
||||
<if test="slzq != null and slzq !=''">slzq,</if>
|
||||
create_by,create_time
|
||||
)
|
||||
values (
|
||||
@ -87,6 +88,7 @@
|
||||
<if test="Status != null and Status !=''">#{Status},</if>
|
||||
<if test="reqDetailName != null and reqDetailName !=''">#{reqDetailName},</if>
|
||||
<if test="bz != null and bz !=''">#{bz},</if>
|
||||
<if test="slzq != null and slzq !=''">#{slzq},</if>
|
||||
#{create_by},#{create_time}
|
||||
)
|
||||
</insert>
|
||||
@ -141,6 +143,7 @@
|
||||
<if test="Status != null and Status != ''">Status = #{Status},</if>
|
||||
<if test="reqDetailName != null and reqDetailName != ''">reqDetailName = #{reqDetailName},</if>
|
||||
<if test="bz != null and bz != ''">bz = #{bz},</if>
|
||||
<if test="slzq != null and slzq != ''">slzq = #{slzq},</if>
|
||||
applyid = #{applyid}
|
||||
</set>
|
||||
where applyid = #{applyid}
|
||||
|
||||
@ -1,9 +1,13 @@
|
||||
package com.transitPlatForm.transitPF.controller;
|
||||
|
||||
import com.transitPlatForm.common.annotation.Log;
|
||||
import com.transitPlatForm.common.core.controller.BaseController;
|
||||
import com.transitPlatForm.common.core.domain.Result;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.RegRequestInfoDTO;
|
||||
import com.transitPlatForm.common.enums.BusinessType;
|
||||
import com.transitPlatForm.interfaceCommon.constants.SysLogConstants;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.reqinfo.RegRequestInfoDTO;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.ReqApplyInfoDTO;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.reqinfo.printDTO;
|
||||
import com.transitPlatForm.transitPF.service.RegRequestInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -11,6 +15,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 自助开单界面
|
||||
*/
|
||||
@ -32,21 +38,24 @@ public class RegRequestInfoController extends BaseController {
|
||||
|
||||
@ApiOperation("获取病人明细信息")
|
||||
@GetMapping("/queryReqDetail")
|
||||
public Result queryReqDetail(String applyId){
|
||||
public Result queryReqDetail(String applyId) {
|
||||
return regRequestInfoService.queryReqDetail(applyId);
|
||||
}
|
||||
|
||||
@ApiOperation("开单项目信息")
|
||||
@GetMapping("/getItemInfo")
|
||||
public Result getItemInfo(){
|
||||
public Result getItemInfo() {
|
||||
return regRequestInfoService.getItemInfo();
|
||||
}
|
||||
|
||||
|
||||
@Log(title = SysLogConstants.REQINPUT, businessType = BusinessType.INSERT)
|
||||
@ApiOperation("保存申请单信息")
|
||||
@PostMapping("/saveReqInfo")
|
||||
public Result saveReqInfo(@RequestBody ReqApplyInfoDTO reqApplyInfoDTO){
|
||||
public Result saveReqInfo(@RequestBody ReqApplyInfoDTO reqApplyInfoDTO) {
|
||||
//设置操作员和登录机构
|
||||
String loginYLJG = getLoginUser().getSysLoginParam().getLoginYLJG();
|
||||
if (loginYLJG == null || loginYLJG.equals("")) return new Result("-1", "获取登录的医疗机构失败!");
|
||||
reqApplyInfoDTO.getRegApply().setUserCode(getUsername());
|
||||
reqApplyInfoDTO.getRegApply().setUserName(getLoginUser().getUser().getNickName());
|
||||
reqApplyInfoDTO.getRegApply().setSrcHospCode(getLoginUser().getSysLoginParam().getLoginYLJG());
|
||||
@ -57,24 +66,29 @@ public class RegRequestInfoController extends BaseController {
|
||||
|
||||
/**
|
||||
* 打印条码
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Log(title = SysLogConstants.REQINPUT, businessType = BusinessType.PRINT)
|
||||
@ApiOperation("打印条码")
|
||||
@GetMapping("/print")
|
||||
public Result printBarCode(String applyId){
|
||||
return regRequestInfoService.printBarCode(applyId,getUsername());
|
||||
@PostMapping("/print")
|
||||
public Result printBarCode(@RequestBody List<printDTO> barCodeList) {
|
||||
return regRequestInfoService.printBarCode(barCodeList, getUsername());
|
||||
}
|
||||
|
||||
@Log(title = SysLogConstants.REQINPUT, businessType = BusinessType.DELETE)
|
||||
@ApiOperation("作废申请单")
|
||||
@GetMapping("/cancelReq")
|
||||
public Result cancelReq(String applyId){
|
||||
return regRequestInfoService.cancelReq(applyId);
|
||||
public Result cancelReq(String applyId) {
|
||||
return regRequestInfoService.cancelReq(applyId);
|
||||
}
|
||||
|
||||
@ApiOperation("打印机插件设置")
|
||||
@GetMapping("/printsetup")
|
||||
public Result printsetup() {
|
||||
return regRequestInfoService.printsetup();
|
||||
}
|
||||
|
||||
@ApiOperation("打印机插件检查")
|
||||
@GetMapping("/printcheck")
|
||||
public Result printcheck() {
|
||||
|
||||
@ -59,12 +59,12 @@ public class RegTransitSampleController extends BaseController {
|
||||
}
|
||||
|
||||
//@ApiOperation("条码退回")
|
||||
@PostMapping("/sampleSignBack")
|
||||
public Result sampleSignBack(@RequestBody SampleSignVO sampleSignVO){
|
||||
List<String> barcode = sampleSignVO.getBarcode();
|
||||
String status = sampleSignVO.getStatus();
|
||||
return regTransitSampleService.sampleSignBack(barcode,getUsername(),status);
|
||||
}
|
||||
// @PostMapping("/sampleSignBack")
|
||||
// public Result sampleSignBack(@RequestBody SampleSignVO sampleSignVO){
|
||||
// List<String> barcode = sampleSignVO.getBarcode();
|
||||
// String status = sampleSignVO.getStatus();
|
||||
// return regTransitSampleService.sampleSignBack(barcode,getUsername(),status);
|
||||
// }
|
||||
|
||||
@ApiOperation("获取标本条码退回数据")
|
||||
@GetMapping("querySampleSignBack")
|
||||
|
||||
@ -8,6 +8,7 @@ import com.transitPlatForm.common.core.page.TableDataInfo;
|
||||
import com.transitPlatForm.common.enums.BusinessType;
|
||||
import com.transitPlatForm.common.utils.poi.ExcelUtil;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegDict;
|
||||
import com.transitPlatForm.interfaceCommon.constants.SysLogConstants;
|
||||
import com.transitPlatForm.transitPF.service.RegDictService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -37,7 +38,7 @@ public class RegDictController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
@ApiOperation("字典导出")
|
||||
@Log(title = "字典导出", businessType = BusinessType.EXPORT)
|
||||
@Log(title = SysLogConstants.DICT, businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RegDict post) {
|
||||
List<RegDict> list = regDictService.selectDictList(post);
|
||||
@ -64,7 +65,7 @@ public class RegDictController extends BaseController {
|
||||
* 新增字典
|
||||
*/
|
||||
@ApiOperation("新增字典")
|
||||
@Log(title = "字典管理", businessType = BusinessType.INSERT)
|
||||
@Log(title = SysLogConstants.DICT, businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@Validated @RequestBody RegDict post) {
|
||||
if (!regDictService.checkDictNameUnique(post)) {
|
||||
@ -80,7 +81,7 @@ public class RegDictController extends BaseController {
|
||||
* 修改字典
|
||||
*/
|
||||
@ApiOperation("修改字典")
|
||||
@Log(title = "字典管理", businessType = BusinessType.UPDATE)
|
||||
@Log(title = SysLogConstants.DICT, businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody RegDict post) {
|
||||
if (!regDictService.checkDictNameUnique(post)) {
|
||||
@ -96,7 +97,7 @@ public class RegDictController extends BaseController {
|
||||
* 删除字典
|
||||
*/
|
||||
@ApiOperation("删除字典")
|
||||
@Log(title = "字典管理", businessType = BusinessType.DELETE)
|
||||
@Log(title = SysLogConstants.DICT, businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{dictIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] dictIds) {
|
||||
return toAjax(regDictService.deleteDictByIds(dictIds));
|
||||
@ -111,4 +112,12 @@ public class RegDictController extends BaseController {
|
||||
List<RegDict> posts = regDictService.selectDictAll();
|
||||
return success(posts);
|
||||
}
|
||||
|
||||
@ApiOperation("获取字典最大编码")
|
||||
@GetMapping("/getMaxDictCode")
|
||||
public AjaxResult getMaxDictCode(String dictType) {
|
||||
String loginYLJG = getLoginUser().getSysLoginParam().getLoginYLJG();
|
||||
if(loginYLJG==null || loginYLJG.equals("")) return AjaxResult.error("获取登录的医疗机构失败!");
|
||||
return regDictService.getMaxDictCode(dictType,loginYLJG);
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,4 +80,7 @@ public interface RegDictMapper {
|
||||
RegDict checkDictCodeUnique(@Param("dictCode") String DictCode,@Param("dictType") String dictType);
|
||||
|
||||
List<RegDict> getInfoOne(String dict_type);
|
||||
|
||||
String getMaxDictCode(@Param("dict_type")String dict_type,@Param("hospital_id")String hospital_id);
|
||||
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ package com.transitPlatForm.transitPF.mapper;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegApply;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegApplyDetail;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegTransitSampleDetail;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.RegRequestInfoDTO;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.reqinfo.RegRequestInfoDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.transitPlatForm.transitPF.pojo.DTO;
|
||||
package com.transitPlatForm.transitPF.pojo.DTO.reqinfo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@ -0,0 +1,13 @@
|
||||
package com.transitPlatForm.transitPF.pojo.DTO.reqinfo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class printDTO {
|
||||
private String applyId;
|
||||
private String barcode;
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
package com.transitPlatForm.transitPF.service;
|
||||
|
||||
import com.transitPlatForm.common.core.domain.AjaxResult;
|
||||
import com.transitPlatForm.common.core.domain.Result;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegDict;
|
||||
|
||||
@ -87,4 +88,7 @@ public interface RegDictService {
|
||||
int updateDict(RegDict Dict);
|
||||
|
||||
Result getInfoOne(String dictType);
|
||||
|
||||
AjaxResult getMaxDictCode(String dictType,String loginYLJG);
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package com.transitPlatForm.transitPF.service;
|
||||
|
||||
import com.transitPlatForm.common.core.domain.Result;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.RegRequestInfoDTO;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.reqinfo.RegRequestInfoDTO;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.ReqApplyInfoDTO;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.reqinfo.printDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface RegRequestInfoService {
|
||||
Result queryRegRequestInfo(RegRequestInfoDTO regRequestInfoDTO);
|
||||
@ -13,7 +16,7 @@ public interface RegRequestInfoService {
|
||||
|
||||
Result saveReqInfo(ReqApplyInfoDTO reqApplyInfoDTO);
|
||||
|
||||
Result printBarCode(String applyId,String userName);
|
||||
Result printBarCode(List<printDTO> barCodeList, String userName);
|
||||
|
||||
Result cancelReq(String applyId);
|
||||
Result printcheck();
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
package com.transitPlatForm.transitPF.service.impl;
|
||||
|
||||
import com.transitPlatForm.common.constant.UserConstants;
|
||||
import com.transitPlatForm.common.core.domain.AjaxResult;
|
||||
import com.transitPlatForm.common.core.domain.Result;
|
||||
import com.transitPlatForm.common.exception.ServiceException;
|
||||
import com.transitPlatForm.common.utils.StringUtils;
|
||||
import com.transitPlatForm.interfaceCommon.utils.LisUtil;
|
||||
import com.transitPlatForm.interfaceCommon.utils.cache.RegDictCache;
|
||||
import com.transitPlatForm.transitPF.mapper.RegDictMapper;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegDict;
|
||||
import com.transitPlatForm.transitPF.service.RegDictService;
|
||||
@ -13,6 +16,8 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.transitPlatForm.common.core.domain.AjaxResult.success;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class RegDictServiceImpl implements RegDictService {
|
||||
@ -103,7 +108,11 @@ public class RegDictServiceImpl implements RegDictService {
|
||||
*/
|
||||
@Override
|
||||
public int deleteDictById(Long DictId) {
|
||||
return dictMapper.deleteDictById(DictId);
|
||||
int i = dictMapper.deleteDictById(DictId);
|
||||
//设置缓存
|
||||
RegDict regDict = dictMapper.selectDictById(DictId);
|
||||
RegDictCache.setDictCache(regDict.getDictType(),dictMapper.getInfoOne(regDict.getDictType()));
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -131,7 +140,11 @@ public class RegDictServiceImpl implements RegDictService {
|
||||
*/
|
||||
@Override
|
||||
public int insertDict(RegDict Dict) {
|
||||
return dictMapper.insertDict(Dict);
|
||||
int i = dictMapper.insertDict(Dict);
|
||||
//设置缓存
|
||||
List<RegDict> regDictList = dictMapper.getInfoOne(Dict.getDictType());
|
||||
RegDictCache.setDictCache(Dict.getDictType(),regDictList);
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -142,12 +155,38 @@ public class RegDictServiceImpl implements RegDictService {
|
||||
*/
|
||||
@Override
|
||||
public int updateDict(RegDict Dict) {
|
||||
return dictMapper.updateDict(Dict);
|
||||
int i = dictMapper.updateDict(Dict);
|
||||
//设置缓存
|
||||
List<RegDict> regDictList = dictMapper.getInfoOne(Dict.getDictType());
|
||||
RegDictCache.setDictCache(Dict.getDictType(),regDictList);
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getInfoOne(String dictType) {
|
||||
List<RegDict> regDictList = dictMapper.getInfoOne(dictType);
|
||||
return new Result("0","获取数据成功!",regDictList);
|
||||
List<RegDict> dictCacheList = RegDictCache.getDictCache(dictType);
|
||||
if(dictCacheList == null) {
|
||||
//没取到缓存,则设置缓存
|
||||
dictCacheList = dictMapper.getInfoOne(dictType);
|
||||
RegDictCache.setDictCache(dictType,dictCacheList);
|
||||
}
|
||||
return new Result("0","获取数据成功!",dictCacheList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典的最大值
|
||||
* @param dictType
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getMaxDictCode(String dictType,String loginYLJG) {
|
||||
String maxDictCode = getMaxNo(dictType,loginYLJG);
|
||||
return success((Object) maxDictCode);
|
||||
}
|
||||
|
||||
public synchronized String getMaxNo(String dictType,String loginYLJG){
|
||||
String maxDictCode = dictMapper.getMaxDictCode(dictType,loginYLJG);
|
||||
if(LisUtil.isBank(maxDictCode).equals("")) maxDictCode = "0";
|
||||
return LisUtil.isBank(Integer.parseInt(maxDictCode)+1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,15 +14,15 @@ import com.transitPlatForm.interfaceCommon.mapper.RegApplyDetailMapper;
|
||||
import com.transitPlatForm.interfaceCommon.mapper.RegApplyMapper;
|
||||
import com.transitPlatForm.interfaceCommon.utils.CommonUtil;
|
||||
import com.transitPlatForm.interfaceCommon.utils.LisUtil;
|
||||
import com.transitPlatForm.interfaceCommon.utils.LoginConfigParamUtil;
|
||||
import com.transitPlatForm.interfaceCommon.websocket.ChatWebSocketServer;
|
||||
import com.transitPlatForm.interfaceCommon.websocket.WebSocketMessage;
|
||||
import com.transitPlatForm.interfaceCommon.websocket.WebSocketUser;
|
||||
import com.transitPlatForm.transitPF.mapper.LabIntersendListMapper;
|
||||
import com.transitPlatForm.transitPF.mapper.RegRequestInfoMapper;
|
||||
import com.transitPlatForm.transitPF.mapper.RegTransitSampleMapper;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.RegRequestInfoDTO;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.reqinfo.RegRequestInfoDTO;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.ReqApplyInfoDTO;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.reqinfo.printDTO;
|
||||
import com.transitPlatForm.transitPF.service.RegRequestInfoService;
|
||||
import com.transitPlatForm.transitPF.service.util.RequestInfoUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -34,8 +34,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@ -63,36 +61,39 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
|
||||
/**
|
||||
* 获取申请单列表
|
||||
*
|
||||
* @param regRequestInfoDTO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result queryRegRequestInfo(RegRequestInfoDTO regRequestInfoDTO) {
|
||||
List<RegApply> regApplyList = regRequestInfoMapper.queryRegRequestInfo(regRequestInfoDTO);
|
||||
return new Result("0","查询成功!",regApplyList);
|
||||
return new Result("0", "查询成功!", regApplyList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取明细信息
|
||||
*
|
||||
* @param applyId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result queryReqDetail(String applyId) {
|
||||
RegApply regApply = regApplyMapper.queryOne(applyId);
|
||||
List<RegApplyDetail> regApplyDetailList = regRequestInfoMapper.queryReqDetail(applyId);
|
||||
ReqApplyInfoDTO reqApplyInfoDTO = new ReqApplyInfoDTO(regApply,regApplyDetailList);
|
||||
return new Result("0","查询成功!",reqApplyInfoDTO);
|
||||
List<RegApplyDetail> regApplyDetailList = regRequestInfoMapper.queryReqDetail(applyId);
|
||||
ReqApplyInfoDTO reqApplyInfoDTO = new ReqApplyInfoDTO(regApply, regApplyDetailList);
|
||||
return new Result("0", "查询成功!", reqApplyInfoDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getItemInfo() {
|
||||
List<Map<String, Object>> regItemList = regRequestInfoMapper.getItemInfo();
|
||||
return new Result("0","查询成功!",regItemList);
|
||||
return new Result("0", "查询成功!", regItemList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存申请单信息和条码信息
|
||||
*
|
||||
* @param reqApplyInfoDTO
|
||||
* @return
|
||||
*/
|
||||
@ -101,19 +102,19 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
RegApply regApply = reqApplyInfoDTO.getRegApply();
|
||||
List<RegApplyDetail> regApplyDetailList = reqApplyInfoDTO.getRegApplyDetailList();
|
||||
String status = regApply.getStatus();
|
||||
if(status == null) status = "";
|
||||
if(!status.equals("10") && !status.equals("")) return new Result("-1","不是新增状态不能修改申请单!");
|
||||
if (status == null) status = "";
|
||||
if (!status.equals("10") && !status.equals("")) return new Result("-1", "不是新增状态不能修改申请单!");
|
||||
//修改数据
|
||||
if(!status.equals("")){
|
||||
if (!status.equals("")) {
|
||||
//修改申请单信息
|
||||
applicationContext.getBean(RegRequestInfoServiceImpl.class).updateApply(regApply,regApplyDetailList);
|
||||
applicationContext.getBean(RegRequestInfoServiceImpl.class).updateApply(regApply, regApplyDetailList);
|
||||
//删除条码信息
|
||||
applicationContext.getBean(RegRequestInfoServiceImpl.class).delSampleInfo(regApply.getApplyid());
|
||||
//重新生成条码信息
|
||||
createBarcode(regApply.getApplyid());
|
||||
}else{
|
||||
} else {
|
||||
//申请单号
|
||||
String applyId = "PT"+regApply.getSrcHospCode()+DateUtil.format(commonUtil.getCurrentTime(),"yyyyMMdd")+commonUtil.getNextSeq_pro("applyno",4);
|
||||
String applyId = "PT" + regApply.getSrcHospCode() + DateUtil.format(commonUtil.getCurrentTime(), "yyyyMMdd") + commonUtil.getNextSeq_pro("applyno", 4);
|
||||
regApply.setApplyid(applyId);
|
||||
regApply.setStatus("10"); //申请单状态
|
||||
regApply.setCreate_by(regApply.getUserCode());
|
||||
@ -126,63 +127,60 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
String xmmc = "";
|
||||
for (RegApplyDetail regApplyDetail : regApplyDetailList) {
|
||||
regApplyDetail.setApplyid(applyId);
|
||||
xmmc = xmmc + "," + regApplyDetail.getOrderItemName();
|
||||
xmmc = xmmc + "," + regApplyDetail.getOrderItemName();
|
||||
}
|
||||
regApply.setReqDetailName(xmmc.substring(1));
|
||||
|
||||
//保存申请单信息
|
||||
applicationContext.getBean(RegRequestInfoServiceImpl.class).saveReqInfo(regApply,regApplyDetailList);
|
||||
applicationContext.getBean(RegRequestInfoServiceImpl.class).saveReqInfo(regApply, regApplyDetailList);
|
||||
}
|
||||
|
||||
//生成条码信息
|
||||
Result result = createBarcode(regApply.getApplyid());
|
||||
if(!result.getCode().equals("0")) return result;
|
||||
if (!result.getCode().equals("0")) return result;
|
||||
|
||||
return new Result("0","保存成功!");
|
||||
return new Result("0", "保存成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印条码
|
||||
* @param applyId
|
||||
*
|
||||
* @param barCodeList
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result printBarCode(String applyId,String userName) {
|
||||
//产生条码信息
|
||||
Result result1 = createBarcode(applyId);
|
||||
if(!result1.getCode().equals("0")) return result1;
|
||||
RegTransitSampleDetail regTransitSampleDetail = new RegTransitSampleDetail();
|
||||
regTransitSampleDetail.setApplyid(applyId);
|
||||
List<RegTransitSampleDetail> regTransitSampleDetailList = regTransitSampleMapper.getRegTransitSampleDetail(regTransitSampleDetail);
|
||||
if(regTransitSampleDetailList.size() <= 0) return new Result("-1","没有找到对应的条码信息!");
|
||||
List<String> barcodeList = new ArrayList<>();
|
||||
for (RegTransitSampleDetail transitSampleDetail : regTransitSampleDetailList) {
|
||||
if(barcodeList.contains(transitSampleDetail.getBarcode())) continue;
|
||||
barcodeList.add(transitSampleDetail.getBarcode());
|
||||
public Result printBarCode(List<printDTO> barCodeList, String userName) {
|
||||
List<String> barcodeList1 = new ArrayList<>();
|
||||
for (printDTO printDTO : barCodeList) {
|
||||
String barcode = printDTO.getBarcode();
|
||||
barcodeList1.add(barcode);
|
||||
String applyId = printDTO.getApplyId();
|
||||
RegTransitSample regTransitSample = new RegTransitSample();
|
||||
regTransitSample.setBarcode(barcode);
|
||||
List<RegTransitSample> regTransitSampleList = regTransitSampleMapper.getRegTransitSample(regTransitSample);
|
||||
if (regTransitSampleList.size() <= 0) return new Result("-1", "没有查到该标本的条码信息,请先保存数据!");
|
||||
//修改打印状态
|
||||
applicationContext.getBean(RegRequestInfoServiceImpl.class).updatePrintStatus(applyId, barcode);
|
||||
}
|
||||
Result result = printBar(barcodeList,userName);
|
||||
if(!result.equals("0")) return result;
|
||||
for (String barCode: barcodeList) {
|
||||
//修改状态
|
||||
applicationContext.getBean(RegRequestInfoServiceImpl.class).updatePrintStatus(applyId,barCode);
|
||||
|
||||
}
|
||||
return new Result("0","打印成功!");
|
||||
printBar(barcodeList1, userName);
|
||||
return new Result("0", "打印成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result cancelReq(String applyId) {
|
||||
RegApply regApply = regApplyMapper.queryOne(applyId);
|
||||
if(regApply == null) return new Result("-1","没有找到申请单信息!");
|
||||
if (regApply == null) return new Result("-1", "没有找到申请单信息!");
|
||||
int status = Integer.parseInt(regApply.getStatus());
|
||||
if(status > 40 && status != 100) return new Result("-1","条码已经签收,不允许作废!");
|
||||
if (status > 40 && status != 100) return new Result("-1", "条码已经签收或者已经作废,不允许作废!");
|
||||
List<String> barcodeList = getBarcodeList(applyId);
|
||||
requestInfoUtil.cancelRequest(applyId,barcodeList);
|
||||
return new Result("0","作废申请单成功!");
|
||||
requestInfoUtil.cancelRequest(applyId, barcodeList);
|
||||
return new Result("0", "作废申请单成功!");
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveReqInfo(RegApply regApply,List<RegApplyDetail> regApplyDetailList){
|
||||
public void saveReqInfo(RegApply regApply, List<RegApplyDetail> regApplyDetailList) {
|
||||
regApplyMapper.insert(regApply);
|
||||
for (RegApplyDetail regApplyDetail : regApplyDetailList) {
|
||||
regApplyDetailMapper.insert(regApplyDetail);
|
||||
@ -192,22 +190,23 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
|
||||
/**
|
||||
* 产生条码信息
|
||||
*
|
||||
* @param applyId
|
||||
* @return
|
||||
*/
|
||||
public Result createBarcode(String applyId){
|
||||
public Result createBarcode(String applyId) {
|
||||
String ls_nopriceitems = "";
|
||||
if(applyId == null || applyId.equals("")) return new Result("-1","申请单号不能为空!");
|
||||
if (applyId == null || applyId.equals("")) return new Result("-1", "申请单号不能为空!");
|
||||
RegApply regApply = regApplyMapper.queryOne(applyId);
|
||||
if(regApply == null) return new Result("0","没有找到申请单信息!");
|
||||
if (regApply == null) return new Result("0", "没有找到申请单信息!");
|
||||
RegApplyDetail regApplyDetail1 = new RegApplyDetail();
|
||||
regApplyDetail1.setApplyid(applyId);
|
||||
List<RegApplyDetail> regApplyDetailList = regApplyDetailMapper.queryList(regApplyDetail1);
|
||||
if(regApplyDetailList.size() <= 0) return new Result("0","没有找到申请单明细信息!");
|
||||
if (regApplyDetailList.size() <= 0) return new Result("0", "没有找到申请单明细信息!");
|
||||
|
||||
List<RegTransitSample> regTransitSampleList = new ArrayList<>();
|
||||
List<RegTransitSampleDetail> regTransitSampleDetailList = new ArrayList<>();
|
||||
List<Map<String,Object>> reqSqdInfoList = new ArrayList<>();
|
||||
List<Map<String, Object>> reqSqdInfoList = new ArrayList<>();
|
||||
|
||||
//获取项目的对照信息列表
|
||||
List<Map<String, Object>> feeClassList = commonMapper.getFeeClassList();
|
||||
@ -218,62 +217,62 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
|
||||
//判断申请单是否已经产生条码
|
||||
List<RegTransitSampleDetail> regItemList = regRequestInfoMapper.existSQD(regApplyDetail.getApplyid(), String.valueOf(regApplyDetail.getUid()));
|
||||
if(regItemList.size() > 0) continue;
|
||||
if (regItemList.size() > 0) continue;
|
||||
|
||||
//判断是否对照
|
||||
Map<String, Object> feeClass = commonUtil.getFeeClass(feeClassList,orderItemCode);
|
||||
if(feeClass.size() <= 0) {
|
||||
ls_nopriceitems += "~r~n"+orderItemCode + "|" + orderItemName;
|
||||
Map<String, Object> feeClass = commonUtil.getFeeClass(feeClassList, orderItemCode);
|
||||
if (feeClass.size() <= 0) {
|
||||
ls_nopriceitems += "~r~n" + orderItemCode + "|" + orderItemName;
|
||||
continue;
|
||||
}
|
||||
|
||||
String itemClass = LisUtil.isBank(feeClass.get("itemclass"));
|
||||
String itemClass = LisUtil.isBank(feeClass.get("itemclass"));
|
||||
|
||||
Map<String,Object> reqSqdInfo = new HashMap<>();
|
||||
reqSqdInfo.put("sample_PatId",regApply.getPatId());
|
||||
reqSqdInfo.put("sample_PatCardType",regApply.getPatCardType());
|
||||
reqSqdInfo.put("sample_PatCardNo",regApply.getPatCardNo());
|
||||
reqSqdInfo.put("sample_PatType",regApply.getPatType());
|
||||
reqSqdInfo.put("sample_RegNo",regApply.getRegNo());
|
||||
reqSqdInfo.put("sample_PatName",regApply.getPatName());
|
||||
reqSqdInfo.put("sample_PatSex",regApply.getPatSex());
|
||||
reqSqdInfo.put("sample_PatAge",regApply.getPatAge());
|
||||
reqSqdInfo.put("sample_AgeUnit",regApply.getAgeUnit());
|
||||
reqSqdInfo.put("sample_PatAgeShow",regApply.getPatAgeShow());
|
||||
reqSqdInfo.put("sample_PatBirthday",DateUtil.format(regApply.getPatBirthday(),"yyyy-MM-dd"));
|
||||
reqSqdInfo.put("sample_PatIdentity",regApply.getPatIdentity());
|
||||
reqSqdInfo.put("sample_Phone",regApply.getPhone());
|
||||
reqSqdInfo.put("sample_Address",regApply.getAddress());
|
||||
reqSqdInfo.put("sample_PatFeeType",regApply.getPatFeeType());
|
||||
reqSqdInfo.put("sample_DepartCode",regApply.getDepartCode());
|
||||
reqSqdInfo.put("sample_DepartName",regApply.getDepartName());
|
||||
reqSqdInfo.put("sample_AreaCode",regApply.getAreaCode());
|
||||
reqSqdInfo.put("sample_AreaName",regApply.getAreaName());
|
||||
reqSqdInfo.put("sample_PatBed",regApply.getPatBed());
|
||||
reqSqdInfo.put("sample_DiagnosisCode",regApply.getDiagnosisCode());
|
||||
reqSqdInfo.put("sample_DiagnosisName",regApply.getDiagnosisName());
|
||||
reqSqdInfo.put("sample_OrderUserCode",regApply.getDoctorCode());
|
||||
reqSqdInfo.put("sample_OrderUserName",regApply.getDoctorName());
|
||||
reqSqdInfo.put("sample_OrderTime",DateUtil.format(regApply.getOrderTime(),"yyyy-MM-dd HH:mm:ss"));
|
||||
reqSqdInfo.put("sample_SrcHospCode",regApply.getSrcHospCode());
|
||||
reqSqdInfo.put("sample_SrcHospName",regApply.getSrcHospName());
|
||||
reqSqdInfo.put("sample_SampleTypeCode",regApplyDetail.getSampleTypeCode());
|
||||
reqSqdInfo.put("sample_SampleTypeName",regApplyDetail.getSampleTypeName());
|
||||
reqSqdInfo.put("sample_IsER","0"); //是否急查
|
||||
reqSqdInfo.put("sample_Status","10"); //开单状态
|
||||
reqSqdInfo.put("sample_SrcHospBarcode",itemClass); //条码类别
|
||||
reqSqdInfo.put("sample_UserCode",regApply.getUserCode());
|
||||
reqSqdInfo.put("sample_UserName",regApply.getUserName());
|
||||
reqSqdInfo.put("sample_bz",regApply.getBz());
|
||||
Map<String, Object> reqSqdInfo = new HashMap<>();
|
||||
reqSqdInfo.put("sample_PatId", regApply.getPatId());
|
||||
reqSqdInfo.put("sample_PatCardType", regApply.getPatCardType());
|
||||
reqSqdInfo.put("sample_PatCardNo", regApply.getPatCardNo());
|
||||
reqSqdInfo.put("sample_PatType", regApply.getPatType());
|
||||
reqSqdInfo.put("sample_RegNo", regApply.getRegNo());
|
||||
reqSqdInfo.put("sample_PatName", regApply.getPatName());
|
||||
reqSqdInfo.put("sample_PatSex", regApply.getPatSex());
|
||||
reqSqdInfo.put("sample_PatAge", regApply.getPatAge());
|
||||
reqSqdInfo.put("sample_AgeUnit", regApply.getAgeUnit());
|
||||
reqSqdInfo.put("sample_PatAgeShow", regApply.getPatAgeShow());
|
||||
reqSqdInfo.put("sample_PatBirthday", DateUtil.format(regApply.getPatBirthday(), "yyyy-MM-dd"));
|
||||
reqSqdInfo.put("sample_PatIdentity", regApply.getPatIdentity());
|
||||
reqSqdInfo.put("sample_Phone", regApply.getPhone());
|
||||
reqSqdInfo.put("sample_Address", regApply.getAddress());
|
||||
reqSqdInfo.put("sample_PatFeeType", regApply.getPatFeeType());
|
||||
reqSqdInfo.put("sample_DepartCode", regApply.getDepartCode());
|
||||
reqSqdInfo.put("sample_DepartName", regApply.getDepartName());
|
||||
reqSqdInfo.put("sample_AreaCode", regApply.getAreaCode());
|
||||
reqSqdInfo.put("sample_AreaName", regApply.getAreaName());
|
||||
reqSqdInfo.put("sample_PatBed", regApply.getPatBed());
|
||||
reqSqdInfo.put("sample_DiagnosisCode", regApply.getDiagnosisCode());
|
||||
reqSqdInfo.put("sample_DiagnosisName", regApply.getDiagnosisName());
|
||||
reqSqdInfo.put("sample_OrderUserCode", regApply.getDoctorCode());
|
||||
reqSqdInfo.put("sample_OrderUserName", regApply.getDoctorName());
|
||||
reqSqdInfo.put("sample_OrderTime", DateUtil.format(regApply.getOrderTime(), "yyyy-MM-dd HH:mm:ss"));
|
||||
reqSqdInfo.put("sample_SrcHospCode", regApply.getSrcHospCode());
|
||||
reqSqdInfo.put("sample_SrcHospName", regApply.getSrcHospName());
|
||||
reqSqdInfo.put("sample_SampleTypeCode", regApplyDetail.getSampleTypeCode());
|
||||
reqSqdInfo.put("sample_SampleTypeName", regApplyDetail.getSampleTypeName());
|
||||
reqSqdInfo.put("sample_IsER", "0"); //是否急查
|
||||
reqSqdInfo.put("sample_Status", "10"); //开单状态
|
||||
reqSqdInfo.put("sample_SrcHospBarcode", itemClass); //条码类别
|
||||
reqSqdInfo.put("sample_UserCode", regApply.getUserCode());
|
||||
reqSqdInfo.put("sample_UserName", regApply.getUserName());
|
||||
reqSqdInfo.put("sample_bz", regApply.getBz());
|
||||
|
||||
reqSqdInfo.put("detail_OrderItemCode",regApplyDetail.getOrderItemCode());
|
||||
reqSqdInfo.put("detail_OrderItemName",regApplyDetail.getOrderItemName());
|
||||
reqSqdInfo.put("detail_SrcOrderItemCode",regApplyDetail.getOrderItemCode());
|
||||
reqSqdInfo.put("detail_SrcOrderItemName",regApplyDetail.getOrderItemName());
|
||||
reqSqdInfo.put("detail_cost",regApplyDetail.getAmount());
|
||||
reqSqdInfo.put("detail_DataSource","1");
|
||||
reqSqdInfo.put("detail_applyid",regApply.getApplyid());
|
||||
reqSqdInfo.put("detail_applyDetailId",regApplyDetail.getUid());
|
||||
reqSqdInfo.put("detail_OrderItemCode", regApplyDetail.getOrderItemCode());
|
||||
reqSqdInfo.put("detail_OrderItemName", regApplyDetail.getOrderItemName());
|
||||
reqSqdInfo.put("detail_SrcOrderItemCode", regApplyDetail.getOrderItemCode());
|
||||
reqSqdInfo.put("detail_SrcOrderItemName", regApplyDetail.getOrderItemName());
|
||||
reqSqdInfo.put("detail_cost", regApplyDetail.getAmount());
|
||||
reqSqdInfo.put("detail_DataSource", "1");
|
||||
reqSqdInfo.put("detail_applyid", regApply.getApplyid());
|
||||
reqSqdInfo.put("detail_applyDetailId", regApplyDetail.getUid());
|
||||
reqSqdInfoList.add(reqSqdInfo);
|
||||
|
||||
}
|
||||
@ -288,11 +287,11 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
}
|
||||
});
|
||||
|
||||
String itemClassOne = "" ;
|
||||
int xh = 0,k = -1;
|
||||
String itemClassOne = "";
|
||||
int xh = 0, k = -1;
|
||||
String barcode = "";
|
||||
String jymd = "";
|
||||
RegTransitSample regTransitSample = null;
|
||||
RegTransitSample regTransitSample = null;
|
||||
|
||||
for (Map<String, Object> stringObjectMap : reqSqdInfoList) {
|
||||
String itemClass = LisUtil.isBank(stringObjectMap.get("sample_SrcHospBarcode"));
|
||||
@ -318,7 +317,11 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
} else {
|
||||
xh = 1;
|
||||
//条码号
|
||||
barcode = regApply.getSrcHospCode() + DateUtil.format(commonUtil.getCurrentTime(), "yyyyMMdd") + commonUtil.getNextSeq_pro("barcode", 4);
|
||||
String srcHospCode = regApply.getSrcHospCode();
|
||||
if (srcHospCode.length() == 1) {
|
||||
srcHospCode = String.format("%02d", Integer.valueOf(srcHospCode));
|
||||
}
|
||||
barcode = DateUtil.format(commonUtil.getCurrentTime(), "yyyyMMdd") + srcHospCode + commonUtil.getNextSeq_pro("barcode", 4);
|
||||
itemClassOne = itemClass;
|
||||
}
|
||||
|
||||
@ -376,18 +379,18 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
regTransitSample.setCreate_by(LisUtil.isBank(stringObjectMap.get("sample_UserCode")));
|
||||
regTransitSample.setCreate_time(commonUtil.getCurrentTime());
|
||||
regTransitSample.setExpressNum(LisUtil.isBank(stringObjectMap.get("sample_bz")));
|
||||
regTransitSampleList.add(k,regTransitSample);
|
||||
regTransitSampleList.add(k, regTransitSample);
|
||||
}
|
||||
|
||||
//保存数据
|
||||
applicationContext.getBean(RegRequestInfoServiceImpl.class).saveTransitSample(regTransitSampleList, regTransitSampleDetailList);
|
||||
|
||||
|
||||
if(!ls_nopriceitems.equals("")){
|
||||
return new Result("-1","有如下项目未分类无法生成条码,请先分类:"+ls_nopriceitems);
|
||||
if (!ls_nopriceitems.equals("")) {
|
||||
return new Result("-1", "有如下项目未分类无法生成条码,请先分类:" + ls_nopriceitems);
|
||||
}
|
||||
|
||||
return new Result("0","生成条码成功!");
|
||||
return new Result("0", "生成条码成功!");
|
||||
|
||||
}
|
||||
|
||||
@ -403,7 +406,7 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateApply(RegApply regApply, List<RegApplyDetail> regApplyDetailList){
|
||||
public void updateApply(RegApply regApply, List<RegApplyDetail> regApplyDetailList) {
|
||||
RegApplyDetail regApplyDetail1 = new RegApplyDetail();
|
||||
regApplyDetail1.setApplyid(regApply.getApplyid());
|
||||
String xmmc = "";
|
||||
@ -420,10 +423,11 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
|
||||
/**
|
||||
* 删除条码信息
|
||||
*
|
||||
* @param applyId
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delSampleInfo(String applyId){
|
||||
public void delSampleInfo(String applyId) {
|
||||
RegTransitSampleDetail regTransitSampleDetail = new RegTransitSampleDetail();
|
||||
regTransitSampleDetail.setApplyid(applyId);
|
||||
List<RegTransitSampleDetail> regTransitSampleDetailList = regTransitSampleMapper.getRegTransitSampleDetail(regTransitSampleDetail);
|
||||
@ -435,9 +439,10 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
|
||||
/**
|
||||
* 打印条码
|
||||
*
|
||||
* @param barcode
|
||||
*/
|
||||
public Result printBar(List<String> barcode,String userName){
|
||||
public Result printBar(List<String> barcode, String userName) {
|
||||
String sqhStr = StrUtil.join(",", barcode);
|
||||
LabIntersendList labIntersendList = new LabIntersendList();
|
||||
String guid = UUID.randomUUID().toString();
|
||||
@ -447,16 +452,16 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
labIntersendList.setUserid(userName);
|
||||
labIntersendList.setCreatedate(commonUtil.getCurrentTime());
|
||||
labIntersendListMapper.insert(labIntersendList);
|
||||
WebSocketMessage wsMessage=new WebSocketMessage();
|
||||
WebSocketMessage wsMessage = new WebSocketMessage();
|
||||
wsMessage.setMsgType("lisbarprint");
|
||||
wsMessage.setData("lisbarprint://"+guid);
|
||||
wsMessage.setData("lisbarprint://" + guid);
|
||||
wsMessage.setSenderId(SecurityUtils.getUsername());
|
||||
return sendprintmsg(JSONUtil.toJsonStr(wsMessage));
|
||||
}
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updatePrintStatus(String applyId,String barCode){
|
||||
public void updatePrintStatus(String applyId, String barCode) {
|
||||
//修改申请单状态
|
||||
RegApply regApply = new RegApply();
|
||||
regApply.setStatus("20");
|
||||
@ -471,63 +476,66 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
}
|
||||
|
||||
|
||||
public List<String> getBarcodeList(String applyId){
|
||||
public List<String> getBarcodeList(String applyId) {
|
||||
List<String> barcodeList = new ArrayList<>();
|
||||
if(applyId == null || applyId.equals("")) return barcodeList;
|
||||
if (applyId == null || applyId.equals("")) return barcodeList;
|
||||
RegTransitSampleDetail regTransitSampleDetail = new RegTransitSampleDetail();
|
||||
regTransitSampleDetail.setApplyid(applyId);
|
||||
List<RegTransitSampleDetail> regTransitSampleDetailList = regTransitSampleMapper.getRegTransitSampleDetail(regTransitSampleDetail);
|
||||
if(regTransitSampleDetailList.size() <= 0) return barcodeList;
|
||||
if (regTransitSampleDetailList.size() <= 0) return barcodeList;
|
||||
|
||||
for (RegTransitSampleDetail transitSampleDetail : regTransitSampleDetailList) {
|
||||
if(barcodeList.contains(transitSampleDetail.getBarcode())) continue;
|
||||
if (barcodeList.contains(transitSampleDetail.getBarcode())) continue;
|
||||
barcodeList.add(transitSampleDetail.getBarcode());
|
||||
}
|
||||
return barcodeList;
|
||||
}
|
||||
|
||||
public Result sendprintmsg(String msg){
|
||||
String ip= IpUtils.getIpAddr();
|
||||
System.out.println("请求业务的IP:"+ip);
|
||||
public Result sendprintmsg(String msg) {
|
||||
String ip = IpUtils.getIpAddr();
|
||||
System.out.println("请求业务的IP:" + ip);
|
||||
List<WebSocketUser> printUsers = ChatWebSocketServer.getOnlineUsersByLoginIp(ip);
|
||||
if (printUsers.isEmpty()) {
|
||||
String webid=getLocalid();
|
||||
printUsers= ChatWebSocketServer.getOnlineUsersByWebId(webid);
|
||||
String webid = getLocalid();
|
||||
printUsers = ChatWebSocketServer.getOnlineUsersByWebId(webid);
|
||||
}
|
||||
if (printUsers.isEmpty()) {
|
||||
System.out.println("当前客户端打印插件不在线");
|
||||
return new Result("-1","当前客户端打印插件不在线");
|
||||
return new Result("-1", "当前客户端打印插件不在线");
|
||||
}
|
||||
WebSocketUser webSocketUser=printUsers.get(0);
|
||||
WebSocketUser webSocketUser = printUsers.get(0);
|
||||
ChatWebSocketServer.sendToUser(webSocketUser.getUserId(), msg);
|
||||
System.out.println("已给客户端[" + webSocketUser.getUsername() + "]推送打印通知,IP:" + webSocketUser.getLoginIp());
|
||||
return new Result("0","打印成功");
|
||||
return new Result("0", "打印成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result printcheck(){
|
||||
String ip= IpUtils.getIpAddr();
|
||||
public Result printcheck() {
|
||||
String ip = IpUtils.getIpAddr();
|
||||
String UserId = ChatWebSocketServer.getUserIdByIp(ip);
|
||||
if(UserId==null||"".equals(UserId)){
|
||||
String webid=getLocalid();
|
||||
UserId=ChatWebSocketServer.getUsersByWebId(webid);
|
||||
if(UserId!=null&&!"".equals(UserId)){
|
||||
return new Result("0","客户端插件正常");
|
||||
if (UserId == null || "".equals(UserId)) {
|
||||
String webid = getLocalid();
|
||||
UserId = ChatWebSocketServer.getUsersByWebId(webid);
|
||||
if (UserId != null && !"".equals(UserId)) {
|
||||
return new Result("0", "客户端插件正常");
|
||||
}
|
||||
return new Result("-1","当前客户端打印插件不在线或未安装");
|
||||
return new Result("-1", "当前客户端打印插件不在线或未安装");
|
||||
}
|
||||
return new Result("0","客户端插件正常");
|
||||
return new Result("0", "客户端插件正常");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result printsetup(){
|
||||
WebSocketMessage wsMessage=new WebSocketMessage();
|
||||
public Result printsetup() {
|
||||
WebSocketMessage wsMessage = new WebSocketMessage();
|
||||
wsMessage.setMsgType("lisbarprint");
|
||||
wsMessage.setData("lisbarprint://setup");
|
||||
wsMessage.setSenderId(SecurityUtils.getUsername());
|
||||
return sendprintmsg(JSONUtil.toJsonStr(wsMessage));
|
||||
}
|
||||
|
||||
private String getLocalid() {
|
||||
SysLoginParam user= SecurityUtils.getLoginUser().getSysLoginParam();
|
||||
if(user!=null) {
|
||||
SysLoginParam user = SecurityUtils.getLoginUser().getSysLoginParam();
|
||||
if (user != null) {
|
||||
return user.getLocalid();
|
||||
}
|
||||
return null;
|
||||
|
||||
@ -94,9 +94,11 @@ public class RegTransitSampleServiceImpl implements RegTransitSampleService {
|
||||
SysUser sysUserOne = commonUtil.getSysUserOne(userId);
|
||||
if(sysUserOne == null) return new Result("-1","未查询到员工信息!");
|
||||
String nickName = sysUserOne.getNickName();
|
||||
String statusSample = regTransitSample.getStatus();
|
||||
switch (status){
|
||||
case "20": //标本采集
|
||||
if(affirmTime == null) return new Result("-1","affirmTime标本采集时间不能为空!");
|
||||
if(statusSample.equals("20")) return new Result("0","该标本已经采集!");
|
||||
if(affirmUserName == null || affirmUserName.equals("")) return new Result("-1","affirmUserName标本采集人姓名不能为空!");
|
||||
regTransitSample.setAffirmTime(affirmTime);
|
||||
regTransitSample.setAffirmUserCode(affirmUserCode);
|
||||
@ -105,6 +107,7 @@ public class RegTransitSampleServiceImpl implements RegTransitSampleService {
|
||||
if(dstHospName == null || dstHospName.equals("")) return new Result("-1","dstHospName不能为空!");
|
||||
if(sendPackTime == null) return new Result("-1","sendPackTime不能为空!");
|
||||
if(sendUserName == null || sendUserName.equals("")) return new Result("-1","sendUserName不能为空!");
|
||||
if(statusSample.equals("30")) return new Result("0","该标本已经送检!");
|
||||
regTransitSample.setDstHospCode(dstHospCode);
|
||||
regTransitSample.setDstHospName(dstHospName);
|
||||
regTransitSample.setSendPackTime(sendPackTime);
|
||||
@ -112,12 +115,13 @@ public class RegTransitSampleServiceImpl implements RegTransitSampleService {
|
||||
regTransitSample.setSendUserName(sendUserName);
|
||||
break;
|
||||
case "50": //标本签收
|
||||
if(statusSample.equals("50")) return new Result("0","该标本已经签收!");
|
||||
regTransitSample.setSignInTime(commonUtil.getCurrentTime());
|
||||
regTransitSample.setSignInUserCode(userId);
|
||||
regTransitSample.setSignInUserName(nickName);
|
||||
break;
|
||||
case "100": //标本退回
|
||||
regTransitSample.setBackReasons(backReasons);
|
||||
if(statusSample.equals("100")) return new Result("0","该标本已经退回!");
|
||||
regTransitSample.setBackUserCode(userId);
|
||||
regTransitSample.setBackUserName(nickName);
|
||||
regTransitSample.setBackTime(commonUtil.getCurrentTime());
|
||||
|
||||
@ -122,5 +122,9 @@
|
||||
select * from reg_dict where dict_type = #{dict_type}
|
||||
</select>
|
||||
|
||||
<select id="getMaxDictCode">
|
||||
select max(dict_code) from reg_dict where dict_type = #{dict_type} and hospital_id = #{hospital_id}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@ -11,12 +11,12 @@
|
||||
</select>
|
||||
|
||||
<select id="queryReqDetail" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegApplyDetail">
|
||||
select a.*,b.itemclass, c.classid,d.barcode from reg_apply_detail a left join reg_TransitSample_detail d on (d.applyid = a.applyid and d.applyDetailId = a.uid),reg_item b,reg_itemclass c
|
||||
select a.*,b.itemclass, c.classid,d.barcode,c.itemclass_bkcolor,c.itemclass_tips from reg_apply_detail a left join reg_TransitSample_detail d on (d.applyid = a.applyid and d.applyDetailId = a.uid),reg_item b,reg_itemclass c
|
||||
where a.applyid = #{applyid} and a.OrderItemCode = b.itemcode and c.itemclass_code = b.itemclass
|
||||
</select>
|
||||
|
||||
<select id="getItemInfo" resultType="map">
|
||||
select b.classid,(case when isnull(a.yblx,'') = '' then b.itemclass_yblx else a.yblx end) as itemclass_yblx, a.* from reg_item a,reg_itemclass b where a.itemclass = b.itemclass_code and a.status = '0'
|
||||
select b.itemclass_tips, b.classid,(case when isnull(a.yblx,'') = '' then b.itemclass_yblx else a.yblx end) as itemclass_yblx, a.* from reg_item a,reg_itemclass b where a.itemclass = b.itemclass_code and a.status = '0'
|
||||
</select>
|
||||
|
||||
<select id="existSQD" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegTransitSampleDetail">
|
||||
|
||||
@ -88,6 +88,7 @@
|
||||
<if test="ExpressComName != null and ExpressComName != ''">ExpressComName,</if>
|
||||
<if test="PackSerial != null and PackSerial != ''">PackSerial,</if>
|
||||
<if test="ExpressNum != null and ExpressNum != ''">ExpressNum,</if>
|
||||
<if test="slzq != null and slzq != ''">slzq,</if>
|
||||
create_by,create_time,update_by,update_time
|
||||
)values(
|
||||
<if test="PatId != null and PatId != ''">#{PatId},</if>
|
||||
@ -144,6 +145,7 @@
|
||||
<if test="ExpressComName != null and ExpressComName != ''">#{ExpressComName},</if>
|
||||
<if test="PackSerial != null and PackSerial != ''">#{PackSerial},</if>
|
||||
<if test="ExpressNum != null and ExpressNum != ''">#{ExpressNum},</if>
|
||||
<if test="slzq != null and slzq != ''">#{slzq},</if>
|
||||
#{create_by},#{create_time},#{update_by},#{update_time}
|
||||
)
|
||||
</insert>
|
||||
@ -251,6 +253,7 @@
|
||||
<if test="BackUserCode != null and BackUserCode != ''">BackUserCode = #{BackUserCode},</if>
|
||||
<if test="BackUserName != null and BackUserName != ''">BackUserName = #{BackUserName},</if>
|
||||
<if test="BackTime != null">BackTime = #{BackTime},</if>
|
||||
<if test="slzq != null and slzq != ''">slzq,</if>
|
||||
update_by = #{update_by},update_time = #{update_time}
|
||||
</set>
|
||||
where barcode = #{barcode}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user