脐血库2020-06-12版本

master
zengwh 6 years ago
parent 1b6326c593
commit bafd3f3785

@ -124,8 +124,7 @@ public class DictionaryController {
@OptionalLog(module = "新增",methods = "字典",fieldName = "typename")
@RequestMapping("add")
@ResponseBody
public ResultUtil add(Emr_Dictionary dictionary, HttpServletRequest request) {
try{
public ResultUtil add(Emr_Dictionary dictionary, HttpServletRequest request) throws Exception{
if(StringUtils.isNotBlank(dictionary.getParentId()) && "0".equals(dictionary.getParentId())){
if(StringUtils.isBlank(dictionary.getTypecode())){
return ResultUtil.error("类别代码不能为空!");
@ -143,10 +142,6 @@ public class DictionaryController {
}
emrDictionaryService.add(dictionary,request);
return ResultUtil.ok(dictionary.getId().toString());
}catch (Exception e){
e.printStackTrace();
return null;
}
}
/**
@ -165,8 +160,7 @@ public class DictionaryController {
@OptionalLog(module = "修改",methods = "字典",fieldName = "typename")
@RequestMapping("update")
@ResponseBody
public ResultUtil update(Emr_Dictionary dictionary, HttpServletRequest request) {
try{
public ResultUtil update(Emr_Dictionary dictionary, HttpServletRequest request) throws Exception{
if(StringUtils.isNotBlank(dictionary.getParentId()) && "0".equals(dictionary.getParentId())){
if(StringUtils.isBlank(dictionary.getTypecode())){
return ResultUtil.error("类别代码不能为空!");
@ -184,10 +178,6 @@ public class DictionaryController {
}
emrDictionaryService.update(dictionary,request);
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return null;
}
}
/**
@ -206,14 +196,9 @@ public class DictionaryController {
@OptionalLog(module = "删除",methods = "字典")
@RequestMapping("delete")
@ResponseBody
public ResultUtil delete(Integer id) {
try{
public ResultUtil delete(Integer id) throws Exception{
emrDictionaryService.delete(id);
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return null;
}
}
/**

@ -14,6 +14,7 @@ import com.lowagie.text.Utilities;
import com.lowagie.text.pdf.*;
import com.lowagie.text.pdf.codec.TiffImage;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.util.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -71,12 +72,11 @@ public class FontController {
*/
@RequestMapping(value= "getLockList",method = RequestMethod.GET)
@ResponseBody
public Msg getLockList(LockVo lock) {
try {
public Msg getLockList(LockVo lock) throws Exception{
FontCommom commom = new FontCommom();
BeanUtils.copyProperties(lock, commom);
int existInpatient = commomMapper.isExistInpatient(commom);
if (existInpatient == 0) {
List<FontCommom> list = commomMapper.isExistInpatient(commom);
if (CollectionUtils.isEmpty(list)) {
return Msg.fail("该病案不存在!");
}
//根据条件查询结果
@ -85,10 +85,6 @@ public class FontController {
return Msg.fail("无该锁定记录!");
}
return Msg.success().add("list", locks);
} catch (Exception e) {
e.printStackTrace();
return Msg.fail("查询出错了,请联系系统管理员!");
}
}
/**
@ -106,8 +102,7 @@ public class FontController {
*/
@RequestMapping("getInpatientList")
@ResponseBody
public Msg getInpatientList(FontCommom commom) {
try {
public Msg getInpatientList(FontCommom commom) throws Exception{
Msg msg = getScanAssortVoList(commom,0);
if (msg.getCode() == 200) {
return msg;
@ -119,17 +114,13 @@ public class FontController {
} else {
return Msg.fail("该病案不存在!");
}
} catch (Exception e) {
e.printStackTrace();
return Msg.fail("查询出错了,请联系系统管理员!");
}
}
/**
*
*/
private Msg getScanAssortVoList(FontCommom commom,int flag) {
private Msg getScanAssortVoList(FontCommom commom,int flag) throws Exception{
//判断参数是否不为全空
if (StringUtils.isNotBlank(commom.getPatientId()) && StringUtils.isBlank(commom.getInpatientNo()) && StringUtils.isBlank(commom.getAdmissId()) &&StringUtils.isNotBlank(commom.getName())
&& null == commom.getAdmissTimes() && StringUtils.isBlank(commom.getDisDate()) && StringUtils.isBlank(commom.getIdCard())) {
@ -143,14 +134,10 @@ public class FontController {
//判断住院记录是否存在
if(flag == 1){
//是否需要判断
try {
int existInpatient = commomMapper.isExistInpatient(commom);
if (existInpatient == 0) {
List<FontCommom> list = commomMapper.isExistInpatient(commom);
if (CollectionUtils.isEmpty(list)) {
return Msg.fail("该病案不存在!");
}
} catch (Exception e) {
e.printStackTrace();
}
}
return Msg.success();
}
@ -170,12 +157,11 @@ public class FontController {
*/
@RequestMapping(value="getScanAssortPathList",method = RequestMethod.GET)
@ResponseBody
public Msg getScanAssortPathList(FontCommom commom) {
public Msg getScanAssortPathList(FontCommom commom) throws Exception{
Msg msg = getScanAssortVoList(commom,1);
if (msg.getCode() == 200) {
return msg;
}
try {
//根据条件查询分段信息
List<ScanAssortVo> scanAssortVos = scanAssortMapper.seleteScanAssortPath(commom);
List<ScanAssortVoNotFilePath> scanAssortVos1 = new ArrayList<>();
@ -271,10 +257,6 @@ public class FontController {
return Msg.fail("查询无该记录!");
}
return Msg.success().add("list", scanAssortVos1);
} catch (Exception e) {
e.printStackTrace();
return Msg.fail("查询无该记录!");
}
}
/**
@ -292,12 +274,11 @@ public class FontController {
*/
@RequestMapping(value = "getScanAssortFilePathList",method = RequestMethod.GET)
@ResponseBody
public Msg getScanAssortFilePathList(FontCommom commom, HttpServletResponse response) {
public Msg getScanAssortFilePathList(FontCommom commom, HttpServletResponse response) throws Exception{
Msg msg = getScanAssortVoList(commom,1);
if (msg.getCode() == 200) {
return msg;
}
try {
//根据条件查询分段信息
List<ScanAssortVo> scanAssortVos = scanAssortMapper.seleteScanAssortPath(commom);
List<ScanAssortVo1> scanAssortVos1 = new ArrayList<>();
@ -415,10 +396,6 @@ public class FontController {
return Msg.fail("查询无该记录!");
}
return Msg.success().add("list", scanAssortVos1);
} catch (Exception e) {
e.printStackTrace();
return Msg.fail("查询无该记录!");
}
}
//字节码传对象
@ -495,12 +472,7 @@ public class FontController {
*/
@RequestMapping(value = "updateTableCommom", method = RequestMethod.POST)
@ResponseBody
public Msg updateTableCommom(CommomVo commom) {
try {
public Msg updateTableCommom(CommomVo commom) throws Exception{
return fontService.updateTableCommom(commom);
} catch (Exception e) {
e.printStackTrace();
return Msg.fail(e.getMessage());
}
}
}

@ -14,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;

@ -60,8 +60,7 @@ public class HisController {
private CommomService commomService;
@PostMapping("saveProvincial")
@ResponseBody
public ResultUtil saveProvincial(String patientId, HttpServletRequest request){
try {
public ResultUtil saveProvincial(String patientId, HttpServletRequest request) throws Exception{
//查询基本信息
String sql = "SELECT commomtable.*,commomtable1.*,t_charge.case_type FROM commomtable LEFT JOIN commomtable1 ON commomtable.patient_id = commomtable1.patient_id LEFT JOIN t_charge on commomtable.patient_id = t_charge.patient_id" +
" WHERE commomtable.patient_id = '"+ patientId +"'";
@ -100,9 +99,5 @@ public class HisController {
hisService.insertHisBa7(commomVo,dictionarys,tTumourChemotherapies);
}
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("保存出错,请联系系统管理员!");
}
}
}

@ -118,47 +118,32 @@ public class TTumourController {
//加载肿瘤信息
@RequestMapping("loadTumourInfo")
@ResponseBody
public ResultUtil loadTumourInfo(String patientId){
try {
public ResultUtil loadTumourInfo(String patientId) throws Exception{
CommomVo commomVos = commomMapper.selectTumourByPatientId(patientId);
if(null != commomVos){
return ResultUtil.ok(commomVos);
}else{
return ResultUtil.error();
}
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("查询出错了,请联系系统管理员!");
}
}
//加载肿瘤化疗信息
@RequestMapping("loadChemotherapyInfo")
@ResponseBody
public ResultUtil loadChemotherapyInfo(String patientId){
try {
public ResultUtil loadChemotherapyInfo(String patientId) throws Exception{
List<TTumourChemotherapy> tTumourChemotherapies = tumourChemotherapyMapper.selectByPatientId(patientId);
if(null != tTumourChemotherapies && !tTumourChemotherapies.isEmpty()){
return ResultUtil.ok(tTumourChemotherapies);
}else{
return ResultUtil.error();
}
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("查询出错了,请联系系统管理员");
}
}
//保存肿瘤信息
@RequestMapping("saveTumour")
@ResponseBody
public ResultUtil saveTumour(TTumourVo tumourVo, HttpServletRequest request){
try {
public ResultUtil saveTumour(TTumourVo tumourVo, HttpServletRequest request) throws Exception{
tumourService.saveTumour(tumourVo,request);
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("保存失败,请联系系统管理员!");
}
}
}

@ -417,8 +417,7 @@ public class CommomSearchController {
*/
@RequestMapping("getAssortList")
@ResponseBody
public ResultUtil getAssortList(HttpServletRequest request) {
try {
public ResultUtil getAssortList(HttpServletRequest request) throws Exception{
Power_User user = (Power_User) request.getSession().getAttribute("CURRENT_USER");
List<Zd_Assort> zdAssorts = new ArrayList<>();
if (user.getRoleId() == 0 || user.getRoleId() == -100) {
@ -427,10 +426,6 @@ public class CommomSearchController {
zdAssorts = assortMapper.selectAllAndUserReaderByUserIdAndRoleId(user.getUserId(), user.getRoleId());
}
return ResultUtil.ok(zdAssorts);
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error("查询图片分类出错了,请联系系统管理员!");
}
}
/**
@ -507,7 +502,7 @@ public class CommomSearchController {
@OptionalLog(module = "保存",methods = "病案信息修改")
@RequestMapping("updateCommomInfo")
@ResponseBody
public ResultUtil updateCommomInfo(CommomVo commomVo){
public ResultUtil updateCommomInfo(CommomVo commomVo) throws Exception{
if (null != commomVo.getInpatientNo()){
int vo = commomMapper.selectCountByPatients(commomVo.getPatientId());
if (vo > 0){
@ -1124,9 +1119,8 @@ public class CommomSearchController {
@OptionalLog(module = "修改", methods = "档案预览页面病案图片重新分类")
@RequestMapping(value = "updateScanAssort")
@ResponseBody
public ResultUtil updateScanAssort(String patientId, String assortIds, Integer index, String newAssortId) {
public ResultUtil updateScanAssort(String patientId, String assortIds, Integer index, String newAssortId) throws Exception{
if (StringUtils.isNoneBlank(patientId) && StringUtils.isNoneBlank(assortIds) && null != index && StringUtils.isNoneBlank(newAssortId)) {
try {
//根据index:当前pdf页数patientIdadmissIds获取pdf信息
List<ScanPathVo> scanPathVos = getPdfPathVo(index, patientId, assortIds);
List<String> list = new ArrayList<>();
@ -1140,10 +1134,6 @@ public class CommomSearchController {
} else {
return ResultUtil.error("无图片");
}
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
return null;
}
@ -1165,17 +1155,21 @@ public class CommomSearchController {
@OptionalLog(module = "修改", methods = "档案预览页面病案图片重新分类",fieldName = "name",tableName = "commomtable")
@RequestMapping(value = "updateScanAssortByBlood", method = RequestMethod.POST)
@ResponseBody
public ResultUtil updateScanAssortByBlood(CommomVo commomVo,String assortIds, String newAssortId) {
public ResultUtil updateScanAssortByBlood(CommomVo commomVo,String assortIds, String newAssortId) throws Exception{
if (StringUtils.isNoneBlank(commomVo.getPatientId()) && StringUtils.isNoneBlank(assortIds) && StringUtils.isNoneBlank(newAssortId)) {
try {
//根据patientIdadmissIds(scanPage分类图片集合)批量更新分段id assrotdId
//组织picNames
String picNameStr = "";
String[] picNames = assortIds.split(",");
for(String picName : picNames){
if(StringUtils.isNotBlank(picName)){
picNameStr += "'" + picName + "',";
}
}
picNameStr = picNameStr.substring(0,picNameStr.length()-1);
//批量更新
scanAssortService.SimpleUpdateByPatientIdAndScanPages(commomVo.getPatientId(), newAssortId, assortIds);
scanAssortService.SimpleUpdateByPatientIdAndScanPages(commomVo.getPatientId(), newAssortId, picNameStr);
return ResultUtil.ok();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
return null;
}
@ -1449,12 +1443,11 @@ public class CommomSearchController {
@RequestMapping("addCodeType")
@ResponseBody
public ResultUtil addCodeType(Emr_Code_Type codeType, Integer index, String patientId, String assortIds,
HttpServletRequest request) {
HttpServletRequest request) throws Exception{
if (StringUtils.isBlank(assortIds)) {
return ResultUtil.error("没有分段数据,请先在用户分配调阅里添加并分配分段数据!");
}
if (StringUtils.isNoneBlank(patientId) && null != index) {
try {
//验证标志和名称都不能重复
Emr_Code_Type isExistFlag = codeTypeMapper.checkFlagAndNameIsExist(codeType.getTypeFlag(), null);
Emr_Code_Type isExistName = codeTypeMapper.checkFlagAndNameIsExist(null, codeType.getTypeName());
@ -1492,14 +1485,9 @@ public class CommomSearchController {
}
}
}
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
} else {
return null;
}
}
/**
* @MethodName: delCodeTypeById
@ -1517,14 +1505,9 @@ public class CommomSearchController {
@OptionalLog(module = "删除", methods = "编码类别", fieldName = "typeName", tableName = "emr_code_type")
@RequestMapping(value = "delCodeTypeById/{id}")
@ResponseBody
public ResultUtil delCodeTypeById(@PathVariable("id") Integer id) {
try {
public ResultUtil delCodeTypeById(@PathVariable("id") Integer id) throws Exception{
codeTypeService.deleteByPrimaryKey(id);
return ResultUtil.ok();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
}
/********************************************手术编码*******************************************************/
@ -1543,14 +1526,9 @@ public class CommomSearchController {
@RequiresPermissions("/commom/addOperCode")
@RequestMapping(value = "addDiagCode")
@ResponseBody
public ResultUtil addDiagCode(String patientId, String diagNos, String diagNames, String diagCodes, String inhospstats) {
try {
public ResultUtil addDiagCode(String patientId, String diagNos, String diagNames, String diagCodes, String inhospstats) throws Exception{
diagService.addDiagCode(patientId, diagNos, diagNames, diagCodes, inhospstats);
return ResultUtil.ok();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
}
/**
@ -1567,9 +1545,8 @@ public class CommomSearchController {
*/
@RequestMapping(value = "checkOperateNo")
@ResponseBody
public ResultUtil checkOperateNo(String patientId, Short operateNo) {
public ResultUtil checkOperateNo(String patientId, Short operateNo) throws Exception{
if (StringUtils.isNoneBlank(patientId) && operateNo != null) {
try {
//根据patientId和手术编码查询手术编码集合
List<T_Operate> operates = operateService.selectAllByPatientId(patientId, operateNo);
if (operates != null && !operates.isEmpty()) {
@ -1578,9 +1555,6 @@ public class CommomSearchController {
} else {
return ResultUtil.ok();
}
} catch (Exception e) {
e.printStackTrace();
}
}
return ResultUtil.error();
}
@ -1599,15 +1573,10 @@ public class CommomSearchController {
*/
@RequestMapping(value = "getOperByCodeOrName", produces = {"text/json;charset=UTF-8"})
@ResponseBody
public String getOperByCodeOrName(String code, String name) {
public String getOperByCodeOrName(String code, String name) throws Exception{
//根据手术编码和名称查询手术编码对象
try {
List<Zd_Cm3> cm3s = cm3Mapper.selectAll(code, name);
return JSON.toJSONString(cm3s);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
@ -1626,8 +1595,7 @@ public class CommomSearchController {
@OptionalLog(module = "新增", methods = "手术编码", fieldName = "operateName")
@RequestMapping(value = "saveOperCode")
@ResponseBody
public ResultUtil saveOperCode(T_Operate operate, Integer isUpdateOperNo, HttpServletRequest request) {
try {
public ResultUtil saveOperCode(T_Operate operate, Integer isUpdateOperNo, HttpServletRequest request) throws Exception{
if (operate.getCurrentOperateNo() == null) {
//新增
boolean flag = FormTokenFlagUtil.isFlag(request);
@ -1653,10 +1621,6 @@ public class CommomSearchController {
}
}
return ResultUtil.ok();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
}
/**
@ -1675,15 +1639,10 @@ public class CommomSearchController {
@OptionalLog(module = "删除", methods = "手术编码", fieldName = "operateName", tableName = "t_operate")
@RequestMapping(value = "deleteOperCodeByPatientIdAndOperNo")
@ResponseBody
public ResultUtil deleteOperCodeByPatientIdAndOperNo(String patientId, Short operateNo) {
public ResultUtil deleteOperCodeByPatientIdAndOperNo(String patientId, Short operateNo) throws Exception{
if (StringUtils.isNoneBlank(patientId) && null != operateNo) {
try {
operateService.deleteOperCodeByPatientIdAndOperNo(patientId, operateNo);
return ResultUtil.ok();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
} else {
return ResultUtil.error();
}
@ -1704,14 +1663,9 @@ public class CommomSearchController {
@RequiresPermissions("/commom/addOperCode")
@RequestMapping(value = "addOperCode")
@ResponseBody
public ResultUtil addOperCode(String patientId, String operNos, String operDates, String operCodes, String operNames, String operateClasses, String operators, String assistant1s, String assistant2s, String cuts, String chossurgs, String anaesthesiaTypes, String anaesthesiaNames) {
try {
public ResultUtil addOperCode(String patientId, String operNos, String operDates, String operCodes, String operNames, String operateClasses, String operators, String assistant1s, String assistant2s, String cuts, String chossurgs, String anaesthesiaTypes, String anaesthesiaNames) throws Exception{
operateService.addOperCode(patientId, operNos, operDates, operCodes, operNames, operateClasses, operators, assistant1s, assistant2s, cuts, chossurgs, anaesthesiaTypes, anaesthesiaNames);
return ResultUtil.ok();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
}
/**
@ -1728,14 +1682,9 @@ public class CommomSearchController {
*/
@RequestMapping(value = "getDictionaryByTypeCode", produces = {"text/json;charset=UTF-8"})
@ResponseBody
public String getDictionaryByTypeCode(String typeCode) {
try {
public String getDictionaryByTypeCode(String typeCode) throws Exception{
List<Emr_Dictionary> dictionaries = dictionaryMapper.selectDictionaryByTypeCode(typeCode);
return JSON.toJSONString(dictionaries);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
@ -1752,14 +1701,9 @@ public class CommomSearchController {
*/
@RequestMapping(value = "getIcdCodeList", produces = {"text/json;charset=UTF-8"})
@ResponseBody
public String getIcdCodeList() {
try {
public String getIcdCodeList() throws Exception{
List<Zd_Icd_Code> icdCodes = icdCodeMapper.selectAll(null, null);
return JSON.toJSONString(icdCodes);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
@ -1776,14 +1720,9 @@ public class CommomSearchController {
*/
@RequestMapping(value = "getIcdCodeByCodeOrName", produces = {"text/json;charset=UTF-8"})
@ResponseBody
public String getIcdCodeByCodeOrName(String code, String name) {
try {
public String getIcdCodeByCodeOrName(String code, String name) throws Exception{
List<Zd_Icd_Code> icdCodes = icdCodeMapper.selectAll(code, name);
return JSON.toJSONString(icdCodes);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
@ -1800,9 +1739,8 @@ public class CommomSearchController {
*/
@RequestMapping(value = "checkDiagNo")
@ResponseBody
public ResultUtil checkDiagNo(String patientId, Short diagNo) {
public ResultUtil checkDiagNo(String patientId, Short diagNo) throws Exception{
if (StringUtils.isNoneBlank(patientId) && diagNo != null) {
try {
List<T_Diag> diags = diagService.selectAllByPatientId(patientId, diagNo);
if (diags != null && !diags.isEmpty()) {
//存在
@ -1810,9 +1748,6 @@ public class CommomSearchController {
} else {
return ResultUtil.ok();
}
} catch (Exception e) {
e.printStackTrace();
}
}
return ResultUtil.error();
}
@ -1833,8 +1768,7 @@ public class CommomSearchController {
@OptionalLog(module = "保存", methods = "西医诊断编码", fieldName = "diagName")
@RequestMapping(value = "saveDiag")
@ResponseBody
public ResultUtil saveDiag(T_Diag diag, Integer isUpdateOperNo, HttpServletRequest request) {
try {
public ResultUtil saveDiag(T_Diag diag, Integer isUpdateOperNo, HttpServletRequest request) throws Exception{
if (diag.getCurrentDiagNo() == null) {
//新增
boolean flag = FormTokenFlagUtil.isFlag(request);
@ -1860,10 +1794,6 @@ public class CommomSearchController {
}
}
return ResultUtil.ok();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
}
/*****************************************中医诊断********************************************************/
@ -1883,15 +1813,10 @@ public class CommomSearchController {
@OptionalLog(module = "删除", methods = "西医诊断编码", fieldName = "diagName", tableName = "t_diag")
@RequestMapping(value = "deleteCodeByPatientIdAndDiagNo")
@ResponseBody
public ResultUtil deleteCodeByPatientIdAndDiagNo(String patientId, Short diagNo) {
public ResultUtil deleteCodeByPatientIdAndDiagNo(String patientId, Short diagNo) throws Exception{
if (StringUtils.isNoneBlank(patientId) && null != diagNo) {
try {
diagService.deleteDiagByPatientIdAndDiagNo(patientId, diagNo);
return ResultUtil.ok();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
} else {
return ResultUtil.error();
}
@ -1911,9 +1836,8 @@ public class CommomSearchController {
*/
@RequestMapping(value = "checkHerbNo")
@ResponseBody
public ResultUtil checkHerbNo(String patientId, Short herbNo) {
public ResultUtil checkHerbNo(String patientId, Short herbNo) throws Exception{
if (StringUtils.isNoneBlank(patientId) && herbNo != null) {
try {
List<T_Herb_Diag> herbDiags = herbDiagService.selectAllByPatientId(patientId, herbNo);
if (herbDiags != null && !herbDiags.isEmpty()) {
//存在
@ -1921,9 +1845,6 @@ public class CommomSearchController {
} else {
return ResultUtil.ok();
}
} catch (Exception e) {
e.printStackTrace();
}
}
return ResultUtil.error();
}
@ -1944,8 +1865,7 @@ public class CommomSearchController {
@OptionalLog(module = "保存", methods = "中医诊断编码", fieldName = "herbName")
@RequestMapping(value = "saveHerbDiag")
@ResponseBody
public ResultUtil saveHerbDiag(T_Herb_Diag herbDiag, Integer isUpdateOperNo, HttpServletRequest request) {
try {
public ResultUtil saveHerbDiag(T_Herb_Diag herbDiag, Integer isUpdateOperNo, HttpServletRequest request) throws Exception{
if (herbDiag.getCurrentHerbDiagNo() == null) {
//新增
boolean flag = FormTokenFlagUtil.isFlag(request);
@ -1971,10 +1891,6 @@ public class CommomSearchController {
}
}
return ResultUtil.ok();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
}
/**
@ -1993,15 +1909,10 @@ public class CommomSearchController {
@OptionalLog(module = "删除", methods = "中医诊断编码", fieldName = "herbName", tableName = "t_herb_diag")
@RequestMapping(value = "deleteCodeByPatientIdAndHerbNo")
@ResponseBody
public ResultUtil deleteCodeByPatientIdAndHerbNo(String patientId, Short herbNo) {
public ResultUtil deleteCodeByPatientIdAndHerbNo(String patientId, Short herbNo) throws Exception{
if (StringUtils.isNoneBlank(patientId) && null != herbNo) {
try {
herbDiagService.deleteHerbDiagByPatientIdAndHerbNo(patientId, herbNo);
return ResultUtil.ok();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
} else {
return ResultUtil.error();
}
@ -2119,17 +2030,12 @@ public class CommomSearchController {
@RequiresPermissions("/commom/updatePic")
@RequestMapping(value = "updatePic", method = RequestMethod.POST)
@ResponseBody
public ResultUtil updatePic(CommomVo commomVo,@RequestParam(required = false, value = "files") MultipartFile[] files,String assortId) {
try {
String str = commomService.updatePic(files, commomVo.getPatientId(), assortId);
if(StringUtils.isNotBlank(str)){
return ResultUtil.error(str);
public ResultUtil updatePic(CommomVo commomVo,@RequestParam(required = false, value = "files") MultipartFile[] files,String assortId) throws Exception{
ResultUtil resultUtil = commomService.updatePic(files, commomVo.getPatientId(), assortId);
if(!resultUtil.getCode().equals(0)){
return resultUtil;
}
return ResultUtil.ok();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error("上传出错了,请联系系统管理员!");
}
}
/**
@ -2148,17 +2054,12 @@ public class CommomSearchController {
@OptionalLog(module = "删除", methods = "档案预览页面删除病案图片",fieldName = "name",tableName = "commomtable")
@RequestMapping(value = "delScanAssortByBlood", method = RequestMethod.POST)
@ResponseBody
public ResultUtil delScanAssortByBlood(String patientId) {
public ResultUtil delScanAssortByBlood(String patientId) throws Exception{
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String assortIds = request.getParameter("assortIds");
if (StringUtils.isNoneBlank(patientId) && StringUtils.isNoneBlank(assortIds)) {
try {
scanAssortService.SimpleDelByPatientIdAndScanPages(patientId, assortIds);
return ResultUtil.ok();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
return null;
}
@ -2180,14 +2081,9 @@ public class CommomSearchController {
@RequiresPermissions("/commom/addReMark")
@RequestMapping(value="updateRecordReMark",method = RequestMethod.POST)
@ResponseBody
public ResultUtil updateRecordReMark(CommomVo commomVo){
try {
commomMapper.updateRecordReMark(commomVo);
public ResultUtil updateRecordReMark(CommomVo commomVo) throws Exception{
commomService.updateRecordReMark(commomVo);
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("修改失败,请联系系统管理员!");
}
}
/**************************病案备注结束*******************************/
/**************************恢复已删除图片开始*************************/
@ -2282,18 +2178,36 @@ public class CommomSearchController {
@RequiresPermissions("/commom/recoverPic")
@RequestMapping(value="recoverPic",method = RequestMethod.POST)
@ResponseBody
public ResultUtil recoverPic(CommomVo commomVo,String scanPages) {
try {
public ResultUtil recoverPic(CommomVo commomVo,String scanPages) throws Exception{
scanAssortService.recoverPic(commomVo.getPatientId(),scanPages);
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error(e.getMessage());
}
}
/**************************恢复已删除图片结束***********************/
/**************************病案维护开始*****************************/
/**
*
* @param commomBlood
* @return
* @throws Exception
*/
//脐血库
@RequestMapping("validExistForm")
@ResponseBody
public ResultUtil validExistForm(CommomBlood commomBlood) throws Exception{
String patientId = commomBlood.getPatientId();
commomBlood.setPatientId(null);
FontCommom commom = new FontCommom();
BeanUtils.copyProperties(commomBlood,commom);
List<FontCommom> list = commomMapper.isExistInpatient(commom);
if(!CollectionUtils.isEmpty(list)){
//修改的情况,同一份病案返回成功
if(StringUtils.isNotBlank(patientId) && list.get(0).getPatientId().equals(patientId)){
return ResultUtil.ok();
}
return ResultUtil.ok("已存在");
}
return ResultUtil.ok();
}
/**
*
* @param commomBlood
@ -2302,7 +2216,7 @@ public class CommomSearchController {
*/
@OptionalLog(module = "新增", methods = "新增档案")
@RequiresPermissions("/commom/addRecord")
@RequestMapping("addRecord")
@RequestMapping(value="addRecord",method = RequestMethod.POST)
@ResponseBody
public ResultUtil addRecordBlood(@Valid CommomBlood commomBlood,HttpServletRequest request) throws Exception{
//判断formToken
@ -2310,17 +2224,25 @@ public class CommomSearchController {
if(!flag){
return ResultUtil.error("请不要重复提交!");
}
//判断脐血编号不为空
if(StringUtils.isBlank(commomBlood.getInpatientNo())){
return ResultUtil.error("脐血编号不能为空!");
//判断表单不为空和不可重复的字段
ResultUtil result = validFieldOper(commomBlood);
if(!result.getCode().equals(0)){
return result;
}
//判断孕妇姓名不为空
if(StringUtils.isBlank(commomBlood.getName())){
return ResultUtil.error("孕妇姓名不能为空!");
//进入添加病案方法
ResultUtil resultUtil = commomService.addRecordBlood(commomBlood, request);
//有错误返回错误信息
if(!resultUtil.getCode().equals(0)){
return resultUtil;
}
commomService.addRecordBlood(commomBlood);
return ResultUtil.ok();
}
/**
*
* @param request
* @return
*/
@RequestMapping("selectRecordTree")
@ResponseBody
public List<Zd_Assort> selectRecordTree(HttpServletRequest request){
@ -2346,5 +2268,72 @@ public class CommomSearchController {
return null;
}
}
//判断表单不为空和不可重复的字段
private ResultUtil validFieldOper(CommomBlood commomBlood) throws Exception{
String patientId = commomBlood.getPatientId();
//判断脐血编号不为空
String inpatientNo = commomBlood.getInpatientNo();
if(StringUtils.isBlank(inpatientNo)){
return ResultUtil.error("脐血编号不能为空!");
}else{
FontCommom commom = new FontCommom();
commom.setInpatientNo(inpatientNo);
List<FontCommom> list = commomMapper.isExistInpatient(commom);
if(!CollectionUtils.isEmpty(list)){
if(StringUtils.isNotBlank(patientId)){
if(list.get(0).getPatientId().equals(patientId)){
return ResultUtil.ok();
}
}
return ResultUtil.error("脐血编号已存在!");
}
}
//验证协议号是否存在
String admissId = commomBlood.getAdmissId();
if(StringUtils.isNotBlank(admissId)){
FontCommom commom = new FontCommom();
commom.setAdmissId(admissId);
List<FontCommom> list = commomMapper.isExistInpatient(commom);
if(!CollectionUtils.isEmpty(list)){
if(StringUtils.isNotBlank(patientId)){
if(list.get(0).getPatientId().equals(patientId)){
return ResultUtil.ok();
}
}
return ResultUtil.error("协议号已存在!");
}
}
//判断孕妇姓名不为空
if(StringUtils.isBlank(commomBlood.getName())){
return ResultUtil.error("孕妇姓名不能为空!");
}
return ResultUtil.ok();
}
@OptionalLog(module = "修改", methods = "修改档案",fieldName = "name",tableName = "commomtable")
@RequiresPermissions("/commom/updateRecord")
@RequestMapping(value="updateRecordBlood",method = RequestMethod.POST)
@ResponseBody
public ResultUtil updateRecordBlood(CommomBlood commomBlood) throws Exception{
//判断表单不为空和不可重复的字段
ResultUtil resultUtil = validFieldOper(commomBlood);
if(!resultUtil.getCode().equals(0)){
return resultUtil;
}
CommomVo commomVo = new CommomVo();
BeanUtils.copyProperties(commomBlood,commomVo);
commomService.updateRecord(commomVo);
return ResultUtil.ok();
}
@OptionalLog(module = "删除", methods = "删除档案",fieldName = "name",tableName = "commomtable")
@RequiresPermissions("/commom/deleteRecord")
@RequestMapping(value="deleteRecordBlood",method = RequestMethod.POST)
@ResponseBody
public ResultUtil deleteRecordBlood(String patientId) throws Exception{
commomService.deleteRecord(patientId);
return ResultUtil.ok();
}
/**************************病案维护结束*****************************/
}

@ -173,18 +173,13 @@ public class DistributionController {
*/
@RequestMapping("checkAssortName")
@ResponseBody
public ResultUtil checkAssortName(String assortName){
try {
public ResultUtil checkAssortName(String assortName) throws Exception{
Zd_Assort assort = assortMapper.checkAssortName(assortName);
if(assort == null){
return ResultUtil.ok();
}else{
return ResultUtil.error();
}
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error();
}
}
/**
@ -202,8 +197,7 @@ public class DistributionController {
@OptionalLog(module = "保存",methods = "调阅分段信息",fieldName = "assortName")
@RequestMapping("saveDistribution")
@ResponseBody
public ResultUtil saveDistribution(Zd_Assort assort,HttpServletRequest request){
try{
public ResultUtil saveDistribution(Zd_Assort assort,HttpServletRequest request) throws Exception{
if(StringUtils.isBlank(assort.getAssortId())){
Zd_Assort assorts = assortMapper.checkAssortName(assort.getAssortName());
if(assorts != null){
@ -226,10 +220,6 @@ public class DistributionController {
}
}
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("保存出错啦!");
}
}
/**
@ -272,14 +262,9 @@ public class DistributionController {
@OptionalLog(module = "删除",methods = "调阅分段信息",fieldName = "assortName",tableName = "zd_assort")
@RequestMapping("deleteAssortByAssortId/{assortId}")
@ResponseBody
public ResultUtil deleteAssortByAssortId(@PathVariable("assortId") String assortId){
try{
public ResultUtil deleteAssortByAssortId(@PathVariable("assortId") String assortId) throws Exception{
assortService.deleteAssortByAssortId(assortId);
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return null;
}
}
/**
@ -328,8 +313,7 @@ public class DistributionController {
@OptionalLog(module = "保存",methods = "调阅分配")
@RequestMapping("saveUserOrRoleReader")
@ResponseBody
public ResultUtil saveUserOrRoleReader(Integer userId, Integer roleId, Integer roleIdByUser, String selects, HttpServletRequest request){
try{
public ResultUtil saveUserOrRoleReader(Integer userId, Integer roleId, Integer roleIdByUser, String selects, HttpServletRequest request) throws Exception{
//先删除后添加
if(null != roleId){
roleRearderService.deleteReaderByRoleId(roleId);
@ -411,10 +395,6 @@ public class DistributionController {
userRearderService.SimpleInsert(list);
}
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return null;
}
}
//封装新增用户权限表公共部分

@ -122,8 +122,7 @@ public class AnnotationTemplateController {
@OptionalLog(module = "保存",methods = "原因及批准模板类别",fieldName = "typeName")
@RequestMapping("addAnoType")
@ResponseBody
public ResultUtil addAnoType(Emr_Reason_Anno_Model reasonAnnoModel, HttpServletRequest request){
try {
public ResultUtil addAnoType(Emr_Reason_Anno_Model reasonAnnoModel, HttpServletRequest request) throws Exception{
if(StringUtils.isBlank(reasonAnnoModel.getTypeFlag()) && reasonAnnoModel.getParentId() == 0){
return ResultUtil.error("类别标志不能为空!");
}
@ -180,10 +179,6 @@ public class AnnotationTemplateController {
result.setCode(0);
result.setMsg(reasonAnnoModel.getId().toString());
return result;
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("保存失败,请联系超管!");
}
}
/**
@ -201,11 +196,10 @@ public class AnnotationTemplateController {
@OptionalLog(module = "保存",methods = "原因及批注模板",fieldName = "content")
@RequestMapping("addAnno")
@ResponseBody
public ResultUtil addAnno(Emr_Reason_Anno_Model reasonAnnoModel,HttpServletRequest request){
public ResultUtil addAnno(Emr_Reason_Anno_Model reasonAnnoModel,HttpServletRequest request) throws Exception{
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
String creater = user.getUserName();
//根据类别验证内容是否是否存在
try {
Emr_Reason_Anno_Model model = annoModelMapper.checkContentByParentId(creater, reasonAnnoModel);
//判断id是否有值为null添加否则更新
if(null == reasonAnnoModel.getId()){
@ -222,10 +216,6 @@ public class AnnotationTemplateController {
}
}
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("保存失败,请联系超管!");
}
}
/**
@ -243,14 +233,9 @@ public class AnnotationTemplateController {
@OptionalLog(module = "删除",methods = "原因及批注模板")
@RequestMapping("deleteAnoType")
@ResponseBody
public ResultUtil deleteAnoType(Integer id){
try {
public ResultUtil deleteAnoType(Integer id) throws Exception{
annotationTemplateService.deleteByPrimaryKey(id);
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return null;
}
}
/**

@ -119,8 +119,7 @@ public class ApproveController {
@OptionalLog(module = "保存",methods = "查询页面保存借阅申请")
@RequestMapping("addApplyApprove")
@ResponseBody
public ResultUtil addApplyApprove(Emr_Apply_Approve applyApprove, String patientIds,HttpServletRequest request){
try{
public ResultUtil addApplyApprove(Emr_Apply_Approve applyApprove, String patientIds,HttpServletRequest request) throws Exception{
boolean flag = FormTokenFlagUtil.isFlag(request);
if (!flag) {
return ResultUtil.error("请不要重复提交!");
@ -186,10 +185,6 @@ public class ApproveController {
}else{
return ResultUtil.error("请至少选中一个!");
}
}catch(Exception e){
e.printStackTrace();
return ResultUtil.error("出错了,请联系系统管理员!");
}
}
//推送给权限系统下发审批人通知
@ -302,8 +297,7 @@ public class ApproveController {
@OptionalLog(module = "保存",methods = "收藏页面与添加申请页面借阅申请",fieldName = "inpatientNo",tableName = "emr_apply_approve")
@RequestMapping("addApply")
@ResponseBody
public ResultUtil addApply(Emr_Apply_Approve applyApprove,String startTime2,String endTime2,HttpServletRequest request){
try{
public ResultUtil addApply(Emr_Apply_Approve applyApprove,String startTime2,String endTime2,HttpServletRequest request) throws Exception{
Power_User powerUser = (Power_User)request.getSession().getAttribute("CURRENT_USER");
if(StringUtils.isBlank(applyApprove.getPatientId())){
if(null != applyApprove.getAdmissTimes() && StringUtils.isNotBlank(applyApprove.getInpatientNo())&&StringUtils.isNotBlank(applyApprove.getName())){
@ -359,18 +353,13 @@ public class ApproveController {
}
}
return ResultUtil.ok();
}catch(Exception e){
e.printStackTrace();
return ResultUtil.error("保存出错了,请联系系统管理员!");
}
}
//脐血库
@OptionalLog(module = "保存",methods = "收藏页面与添加申请页面借阅申请",fieldName = "inpatientNo",tableName = "emr_apply_approve")
@RequestMapping("addApplyBlood")
@ResponseBody
public ResultUtil addApplyBlood(Emr_Apply_Approve applyApprove,String startTime2,String endTime2,HttpServletRequest request){
try{
public ResultUtil addApplyBlood(Emr_Apply_Approve applyApprove,String startTime2,String endTime2,HttpServletRequest request) throws Exception{
Power_User powerUser = (Power_User)request.getSession().getAttribute("CURRENT_USER");
if(StringUtils.isBlank(applyApprove.getPatientId())){
if(StringUtils.isNotBlank(applyApprove.getInpatientNo())&&StringUtils.isNotBlank(applyApprove.getName())){
@ -421,10 +410,6 @@ public class ApproveController {
}
return ResultUtil.ok();
}catch(Exception e){
e.printStackTrace();
return ResultUtil.error("保存出错了,请联系系统管理员!");
}
}
/**
@ -537,14 +522,9 @@ public class ApproveController {
@OptionalLog(module = "删除",methods = "删除借阅申请",fieldName = "inpatientNo",tableName = "emr_apply_approve")
@RequestMapping("deleteApproveById/{id}")
@ResponseBody
public ResultUtil deleteApproveById(@PathVariable("id") Integer id){
try{
public ResultUtil deleteApproveById(@PathVariable("id") Integer id) throws Exception{
applyApproveService.deleteByPrimaryKey(id);
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("删除失败,请联系超管!");
}
}
/**
@ -742,8 +722,7 @@ public class ApproveController {
@OptionalLog(module = "保存",methods = "批注借阅审批申请")
@RequestMapping(value = "updateApprove")
@ResponseBody
public ResultUtil updateApprove(Emr_Apply_Approve applyApprove,HttpServletRequest request){
try{
public ResultUtil updateApprove(Emr_Apply_Approve applyApprove,HttpServletRequest request) throws Exception{
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
String userName = user.getUserName();
applyApprove.setApprover(userName);
@ -751,17 +730,13 @@ public class ApproveController {
applyApprove.setApproveTime(fmt.format(new Date()));
applyApproveService.updateEmrApplyApprove(applyApprove);
return ResultUtil.ok();
}catch(Exception e){
e.printStackTrace();
return ResultUtil.error("批注失败,请联系超管!");
}
}
@RequiresPermissions("/approve/updateApprove")
@OptionalLog(module = "保存",methods = "批注借阅审批申请")
@RequestMapping("updateApproves")
@ResponseBody
public ResultUtil updateApprovs(String[] ids, String state, String note, HttpServletRequest request){
public ResultUtil updateApprovs(String[] ids, String state, String note, HttpServletRequest request) throws Exception{
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
String userName = user.getUserName();
if (null != ids || ids.length > 0){

@ -138,18 +138,13 @@ public class CollectionController {
*/
@RequestMapping("checkTypeFlagOrTypeName")
@ResponseBody
public ResultUtil checkTypeFlagOrTypeName(Emr_Collect emrCollect,HttpServletRequest request){
try {
public ResultUtil checkTypeFlagOrTypeName(Emr_Collect emrCollect,HttpServletRequest request) throws Exception{
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
Emr_Collect emr_collect = emrCollectMapper.checkTypeFlagOrTypeName(user.getUserId(), emrCollect.getCollectTypeFlag(), emrCollect.getCollectTypeName());
if(null != emr_collect){
return ResultUtil.error();
}
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("查询失败,请联系系统管理员");
}
}
/**
@ -167,8 +162,7 @@ public class CollectionController {
@OptionalLog(module = "保存",methods = "收藏类别",fieldName = "collectTypeName")
@RequestMapping("addCollectType")
@ResponseBody
public ResultUtil addCollectType(Emr_Collect emrCollect,HttpServletRequest request){
try {
public ResultUtil addCollectType(Emr_Collect emrCollect,HttpServletRequest request) throws Exception{
//验证类别名称是否重复
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
Integer userId = user.getUserId();
@ -199,10 +193,6 @@ public class CollectionController {
}
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("保存失败,请联系超管!");
}
}
/**
@ -221,14 +211,9 @@ public class CollectionController {
@OptionalLog(module = "删除",methods = "收藏类别",fieldName = "collectTypeName",tableName = "emr_collect")
@RequestMapping("deleteCollectType")
@ResponseBody
public ResultUtil deleteCollectType(Integer id){
try {
public ResultUtil deleteCollectType(Integer id) throws Exception{
emrCollectService.deleteByPrimaryKey(id);
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return null;
}
}
//加载收藏类别
@ -259,10 +244,9 @@ public class CollectionController {
@OptionalLog(module = "保存",methods = "个人收藏",fieldName = "name")
@RequestMapping("addCollect")
@ResponseBody
public ResultUtil addCollect(Emr_Collect emrCollect,String name,String startTime2,String endTime2,HttpServletRequest request){
public ResultUtil addCollect(Emr_Collect emrCollect,String name,String startTime2,String endTime2,HttpServletRequest request) throws Exception{
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
Integer userId = user.getUserId();
try{
String patientId = emrCollect.getPatientId();
//根据同一病案查询标题是否存在
Emr_Collect isPatientId = emrCollectMapper.selectCollectByUserIdAndPatientId(userId,patientId);
@ -306,10 +290,6 @@ public class CollectionController {
return ResultUtil.ok();
}
}
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error();
}
}
//脐血库
@ -317,10 +297,9 @@ public class CollectionController {
@OptionalLog(module = "保存",methods = "个人收藏",fieldName = "name")
@RequestMapping("addCollectBlood")
@ResponseBody
public ResultUtil addCollectBlood(Emr_Collect emrCollect,String name,String startTime2,String endTime2,HttpServletRequest request){
public ResultUtil addCollectBlood(Emr_Collect emrCollect,String name,String startTime2,String endTime2,HttpServletRequest request) throws Exception{
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
Integer userId = user.getUserId();
try{
List<String> patientIdList = commomMapper.selectPatientIdByAdmissTimesAndInpatientNoAndName(null, emrCollect.getInpatientNo(),name,startTime2,endTime2);
String patientId = "";
if(null != patientIdList && !patientIdList.isEmpty()){
@ -364,10 +343,6 @@ public class CollectionController {
return ResultUtil.ok();
}
}
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error();
}
}
/**
@ -575,13 +550,8 @@ public class CollectionController {
@OptionalLog(module = "删除",methods = "个人收藏",fieldName = "inpatientNo",tableName = "emr_collect")
@RequestMapping("deleteCollect/{id}")
@ResponseBody
public ResultUtil deleteCollect(@PathVariable("id")Integer id){
try{
public ResultUtil deleteCollect(@PathVariable("id")Integer id) throws Exception{
emrCollectService.deleteByPrimaryKey(id);
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error();
}
}
}

@ -45,8 +45,7 @@ public class PdfWaterSetController {
@RequestMapping(value="update",method= {RequestMethod.POST})
@ResponseBody
public ResultUtil update(@RequestParam(required = false,value = "files")
MultipartFile files,EmrPdfWaterSet pdfWaterSet){
try{
MultipartFile files,EmrPdfWaterSet pdfWaterSet) throws Exception{
//判断是否有选择图片
if(null != files){
EmrPdfWaterSet obj = pdfWaterSetMapper.selectByPrimaryKey(1);
@ -65,9 +64,5 @@ public class PdfWaterSetController {
}
pdfWaterSetService.updatePdfWaterSet(pdfWaterSet);
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("保存出错了,请联系系统管理员");
}
}
}

@ -103,15 +103,10 @@ public class PrintOrDownLoadInfoController {
*/
@RequestMapping("/printInfoList/getPrintCount")
@ResponseBody
public ResultUtil getPrintCount(String patientId){
try{
public ResultUtil getPrintCount(String patientId) throws Exception{
//查询
List<EmrPrintOrDownLoadInfoVo> list = printOrDownLoadInfoService.getPrintCount(patientId);
return ResultUtil.ok(list);
}catch (Exception e){
e.printStackTrace();
return null;
}
}
/**

@ -125,14 +125,9 @@ public class BackDatabaseController {
@RequiresPermissions("/otherManage/deleteLogById")
@RequestMapping("deleteLogById/{logId}")
@ResponseBody
public ResultUtil deleteLogById(@PathVariable("logId")Integer logId){
try{
public ResultUtil deleteLogById(@PathVariable("logId")Integer logId) throws Exception{
logService.deleteLogById(logId);
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("删除失败,请联系超管!");
}
}
/**
@ -150,8 +145,7 @@ public class BackDatabaseController {
@RequestMapping("deleteLogByIds/{ids}")
@RequiresPermissions("/otherManage/deleteLogByIds")
@ResponseBody
public ResultUtil deleteLogByIds(@PathVariable("ids")String ids){
try{
public ResultUtil deleteLogByIds(@PathVariable("ids")String ids) throws Exception{
String[] idList = ids.split(",");
String str = "";
for (int i = 0; i < idList.length; i++) {
@ -165,10 +159,6 @@ public class BackDatabaseController {
}
logService.deleteLogByIds(str);
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("删除失败,请联系超管!");
}
}
/**

@ -120,8 +120,7 @@ public class BloodAndAgreeStatusSetController {
@RequestMapping("/blood/selectNameExist")
@ResponseBody
public ResultUtil selectNameExist(String name,String code,Integer id){
try {
public ResultUtil selectNameExist(String name,String code,Integer id) throws Exception{
List<BloodAndAgreeStatusTree> list = bloodAndAgreeStatusSetService.selectByCode(code,name);
if(null == id){
//新增
@ -139,10 +138,6 @@ public class BloodAndAgreeStatusSetController {
}
}
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("查询出错了,请联系系统管理员");
}
}
/************************公共部分结束**********************************/

@ -31,8 +31,7 @@ public class CommomSetController {
@RequestMapping("updateCommomSet")
@ResponseBody
public ResultUtil updateCommomSet(EmrComomSet comomSet){
try{
public ResultUtil updateCommomSet(EmrComomSet comomSet) throws Exception{
//判断图片根目录的合法性
String newPicRoot = comomSet.getNewPicRoot();
newPicRoot = newPicRoot.trim();
@ -60,10 +59,6 @@ public class CommomSetController {
comomSet.setNewPicRoot(newPicRoot);
commomSetService.update(comomSet);
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("保存出错了,请联系系统管理员");
}
}
@RequestMapping(value = "getCommomSetList")

@ -156,17 +156,13 @@ public class PrintingController {
*/
@RequestMapping("checkTypeFlagByCreater")
@ResponseBody
public ResultUtil checkTypeFlagByCreater(String typeFlag,HttpServletRequest request){
try { Emr_Type type = emrTypeService.checkTypeFlagByCreater(typeFlag,request);
public ResultUtil checkTypeFlagByCreater(String typeFlag,HttpServletRequest request) throws Exception{
Emr_Type type = emrTypeService.checkTypeFlagByCreater(typeFlag,request);
if(null == type){
return ResultUtil.ok();
}else{
return ResultUtil.error("该类别标识已存在!");
}
}catch (Exception e){
e.printStackTrace();
return null;
}
}
/**
@ -183,17 +179,13 @@ public class PrintingController {
*/
@RequestMapping("checkTypeNameByCreater")
@ResponseBody
public ResultUtil checkTypeNameByCreater(String typeName,HttpServletRequest request){
try { Emr_Type type = emrTypeService.checkTypeNameByCreater(typeName,request);
public ResultUtil checkTypeNameByCreater(String typeName,HttpServletRequest request) throws Exception{
Emr_Type type = emrTypeService.checkTypeNameByCreater(typeName,request);
if(null == type){
return ResultUtil.ok();
}else{
return ResultUtil.error("该类别名称已存在!");
}
}catch (Exception e){
e.printStackTrace();
return null;
}
}
/**
@ -212,8 +204,7 @@ public class PrintingController {
@OptionalLog(module = "新增",methods = "打印类别",fieldName = "typeName")
@RequestMapping("addEmrType")
@ResponseBody
public ResultUtil addEmrType(Emr_Type emrType,HttpServletRequest request){
try{
public ResultUtil addEmrType(Emr_Type emrType,HttpServletRequest request) throws Exception{
boolean flag = FormTokenFlagUtil.isFlag(request);
if(!flag){
return ResultUtil.error("请不要重复提交!");
@ -232,10 +223,6 @@ public class PrintingController {
}else{
return ResultUtil.error("类别标志或类别名称不能为空!");
}
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("添加失败,请联系超管!");
}
}
/**
@ -254,8 +241,7 @@ public class PrintingController {
@OptionalLog(module = "修改",methods = "打印类别",fieldName = "typeName")
@RequestMapping("updateEmrType")
@ResponseBody
public ResultUtil updateEmrType(Emr_Type emrType,Integer selectFlagId,Model model,HttpServletRequest request){
try{
public ResultUtil updateEmrType(Emr_Type emrType,Integer selectFlagId,HttpServletRequest request) throws Exception{
if(StringUtils.isNoneBlank(emrType.getTypeFlag()) && StringUtils.isNotBlank(emrType.getTypeName())) {
Emr_Type type = emrTypeService.checkTypeNameByCreater(emrType.getTypeName(), request);
Emr_Type type1 = emrTypeService.checkTypeFlagByCreater(emrType.getTypeFlag(), request);
@ -270,10 +256,6 @@ public class PrintingController {
}else{
return ResultUtil.error("类别标志或类别名称不能为空!");
}
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error("修改失败,请联系超管!");
}
}
/**
@ -292,14 +274,9 @@ public class PrintingController {
@OptionalLog(module = "删除",methods = "打印类别",fieldName = "typeName",tableName = "emr_type")
@RequestMapping("deleteEmrType")
@ResponseBody
public ResultUtil deleteEmrType(Integer id){
try{
public ResultUtil deleteEmrType(Integer id) throws Exception{
emrTypeService.deleteEmrType(id);
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error();
}
}
/**
@ -363,8 +340,7 @@ public class PrintingController {
@OptionalLog(module = "保存",methods = "打印用途管理分配")
@RequestMapping(value="addTypeRelated")
@ResponseBody
public ResultUtil addTypeRelated(Integer typeId,String selects,HttpServletRequest request){
try {
public ResultUtil addTypeRelated(Integer typeId,String selects,HttpServletRequest request) throws Exception{
//先删除后添加
typeRelatedService.deleteByTypeId(typeId);
if(StringUtils.isNotBlank(selects)){
@ -374,10 +350,6 @@ public class PrintingController {
}else{
return ResultUtil.error("至少选中一个!");
}
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error();
}
}
/**
@ -394,8 +366,7 @@ public class PrintingController {
*/
@RequestMapping(value="udpateCheckByEmrType/{id}")
@ResponseBody
public ResultUtil udpateCheckByEmrType(@PathVariable("id") Integer id,HttpServletRequest request){
try {
public ResultUtil udpateCheckByEmrType(@PathVariable("id") Integer id,HttpServletRequest request) throws Exception{
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
Emr_Type type = emrTypeService.selectByPrimaryKey(id);
//判断是系统管理员,不建议乱修改客户选中的
@ -413,9 +384,5 @@ public class PrintingController {
}
}
return ResultUtil.ok();
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error();
}
}
}

@ -149,18 +149,13 @@ public class TemplateSearchController {
*/
@RequestMapping("checkName")
@ResponseBody
public ResultUtil checkName(Integer parentId, String columnName) {
try{
public ResultUtil checkName(Integer parentId, String columnName) throws Exception{
Integer id = customizeMapper.selectListCheckName(parentId, columnName);
if (id != null) {
return ResultUtil.error();
} else {
return ResultUtil.ok();
}
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error();
}
}
/**
@ -177,18 +172,13 @@ public class TemplateSearchController {
*/
@RequestMapping("checkColumnExist")
@ResponseBody
public ResultUtil checkColumnExist(String columnValue, String tableValue,Integer id) {
try {
public ResultUtil checkColumnExist(String columnValue, String tableValue,Integer id) throws Exception{
Integer existId = customizeMapper.checkColumnExist(columnValue, tableValue);
if (existId == null || id.equals(existId)) {
return ResultUtil.ok();
} else {
return ResultUtil.error();
}
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error();
}
}
/**
@ -207,8 +197,7 @@ public class TemplateSearchController {
@OptionalLog(module = "新增",methods = "自定义模板",fieldName = "columnName")
@RequestMapping("addTemplate")
@ResponseBody
public ResultUtil addTemplate(Emr_Customize customize,HttpServletRequest request) {
try {
public ResultUtil addTemplate(Emr_Customize customize,HttpServletRequest request) throws Exception{
boolean flag = FormTokenFlagUtil.isFlag(request);
if(flag){
if(StringUtils.isBlank(customize.getColumnName())){
@ -226,10 +215,6 @@ public class TemplateSearchController {
}else{
return ResultUtil.error("请不要重复提交!");
}
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error("添加失败,请联系超管!");
}
}
/**
@ -248,8 +233,7 @@ public class TemplateSearchController {
@OptionalLog(module = "修改",methods = "自定义模板",fieldName = "columnName")
@RequestMapping("updateTemplate")
@ResponseBody
public ResultUtil updateTemplate(Emr_Customize customize,HttpServletRequest request) {
try {
public ResultUtil updateTemplate(Emr_Customize customize,HttpServletRequest request) throws Exception{
if(null == customize.getParentId()){
customize.setParentId(0);
}
@ -259,10 +243,6 @@ public class TemplateSearchController {
}
templateSearchService.updateTemplate(customize,request);
return ResultUtil.ok();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error("修改失败,请联系超管!");
}
}
/**
@ -312,14 +292,9 @@ public class TemplateSearchController {
@OptionalLog(module = "删除",methods = "自定义模板",fieldName = "columnName",tableName = "emr_customize")
@RequestMapping("deleteTemplate")
@ResponseBody
public ResultUtil deleteTemplate(Integer id) {
try {
public ResultUtil deleteTemplate(Integer id) throws Exception{
templateSearchService.deleteTemplate(id);
return ResultUtil.ok();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
}
/***************************************自定义模板选择********************************************/
@ -388,23 +363,18 @@ public class TemplateSearchController {
*/
@RequestMapping("checkModleFlag")
@ResponseBody
public ResultUtil checkModleFlag(String modleFlag,HttpServletRequest request) {
public ResultUtil checkModleFlag(String modleFlag,HttpServletRequest request) throws Exception{
if ("系统默认模板".equals(modleFlag)) {
return ResultUtil.error("该模板标识已存在!");
}
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
String creater = user.getUserId().toString();
try {
Emr_Modle modle = emrModleMapper.checkModleFlag(creater, modleFlag);
if(modle == null){
return ResultUtil.ok();
}else{
return ResultUtil.error("该模板标识已存在!");
}
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error();
}
}
/**
@ -421,23 +391,18 @@ public class TemplateSearchController {
*/
@RequestMapping("checkModleName")
@ResponseBody
public ResultUtil checkModleName(String modleName,HttpServletRequest request) {
public ResultUtil checkModleName(String modleName,HttpServletRequest request) throws Exception{
if ("系统默认模板".equals(modleName)) {
return ResultUtil.error("该模板名称已存在!");
}
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
String creater = user.getUserId().toString();
try {
Emr_Modle modle = emrModleMapper.checkModleName(creater, modleName);
if(modle == null){
return ResultUtil.ok();
}else{
return ResultUtil.error("该模板名称已存在!");
}
}catch (Exception e){
e.printStackTrace();
return ResultUtil.error();
}
}
/**
@ -456,8 +421,7 @@ public class TemplateSearchController {
@OptionalLog(module = "新增",methods = "自定义模板分类",fieldName = "modleName")
@RequestMapping("addTemplateSelect")
@ResponseBody
public ResultUtil addTemplateSelect(Emr_Modle emrModle,HttpServletRequest request) {
try {
public ResultUtil addTemplateSelect(Emr_Modle emrModle,HttpServletRequest request) throws Exception{
if(StringUtils.isNotBlank(emrModle.getModleName()) && StringUtils.isNotBlank(emrModle.getModleFlag())){
boolean flag = FormTokenFlagUtil.isFlag(request);
if(flag){
@ -469,10 +433,6 @@ public class TemplateSearchController {
}else{
return ResultUtil.error("模板标识或模板名称不能为空!");
}
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error("添加错误,请联系超管!");
}
}
/**
@ -556,8 +516,7 @@ public class TemplateSearchController {
@OptionalLog(module = "修改",methods = "自定义模板分类",fieldName = "modleName")
@RequestMapping("updateTemplateSelect")
@ResponseBody
public ResultUtil updateTemplateSelect(Emr_Modle modle, Integer selectFlagId,HttpServletRequest request) {
try {
public ResultUtil updateTemplateSelect(Emr_Modle modle, Integer selectFlagId,HttpServletRequest request) throws Exception{
if("系统默认模板".equals(modle.getModleFlag())){
return ResultUtil.error("该模板标识已存在!");
}
@ -580,10 +539,6 @@ public class TemplateSearchController {
}else{
return ResultUtil.error("模板标志或模板名称不能为空!");
}
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error("更新错误!请联系超管");
}
}
/**
@ -600,8 +555,7 @@ public class TemplateSearchController {
*/
@RequestMapping("/udpateCheckByModle/{id}")
@ResponseBody
public ResultUtil udpateCheckByModle(@PathVariable("id")Integer id,HttpServletRequest request) {
try {
public ResultUtil udpateCheckByModle(@PathVariable("id")Integer id,HttpServletRequest request) throws Exception{
//查询默认的,将默认的取消
Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
String creater = user.getUserName();
@ -619,10 +573,6 @@ public class TemplateSearchController {
}else{
return ResultUtil.error("修改失败,该模板为客户创建,不建议修改");
}
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error("更新错误!请联系超管");
}
}
/**
@ -641,14 +591,9 @@ public class TemplateSearchController {
@OptionalLog(module = "删除",methods = "自定义模板分类",fieldName = "modleName",tableName = "emr_modle")
@RequestMapping("deleteTemplateSelect")
@ResponseBody
public ResultUtil deleteTemplateSelect(Integer id) {
try {
public ResultUtil deleteTemplateSelect(Integer id) throws Exception{
templateSearchService.deleteTemplateSelect(id);
return ResultUtil.ok();
} catch (Exception e) {
e.printStackTrace();
return ResultUtil.error();
}
}
/**
@ -750,7 +695,7 @@ public class TemplateSearchController {
@OptionalLog(module = "保存",methods = "自定义模板分配")
@RequestMapping("addModleRelated")
@ResponseBody
public ResultUtil addModleRelated(Integer modleId, String checks,HttpServletRequest request) {
public ResultUtil addModleRelated(Integer modleId, String checks,HttpServletRequest request) throws Exception{
if(modleId != null && StringUtils.isNotBlank(checks)){
try {
templateSearchService.addModleRelated(modleId, checks,request);
@ -991,6 +936,8 @@ public class TemplateSearchController {
Integer unlockOper = 0;
Integer borrowingOper = 0;
Integer downloadOper = 0;
Integer editOper = 0;
Integer delOper = 0;
for(String menu : menus){
if(StringUtils.isNotBlank(menu)){
if("/commom/addLockByPatientId".equals(menu)){
@ -1005,6 +952,12 @@ public class TemplateSearchController {
if("/commom/downloadPdf".equals(menu)){
downloadOper = 1;
}
if("/commom/updateRecord".equals(menu)){
editOper = 1;
}
if("/commom/deleteRecord".equals(menu)){
delOper = 1;
}
}
}
List<Emr_Fun_Group_Distribution> distributions = new ArrayList<>();
@ -1017,6 +970,8 @@ public class TemplateSearchController {
commom.setUnlockOper(unlockOper);
commom.setBorrowingOper(borrowingOper);
commom.setDownloadOper(downloadOper);
commom.setEditOper(editOper);
commom.setDelOper(delOper);
if(null != distributions && !distributions.isEmpty() || user.getRoleId() == 0){
commom.setIsShowDetail(1);
}
@ -1437,8 +1392,7 @@ public class TemplateSearchController {
@OptionalLog(module = "新增",methods = "病案查询页面病案锁定")
@RequestMapping("addLockByPatientId")
@ResponseBody
public ResultUtil addLockByPatientId(String patientIds,HttpServletRequest request){
try{
public ResultUtil addLockByPatientId(String patientIds,HttpServletRequest request) throws Exception{
List<CommomVo> commomtables = commomMapper.selectAllByPatients(patientIds);
if(null != commomtables && !commomtables.isEmpty()){
lockService.insert(commomtables,request);
@ -1446,10 +1400,6 @@ public class TemplateSearchController {
}else{
return null;
}
}catch(Exception e){
e.printStackTrace();
return null;
}
}
/**
@ -1468,8 +1418,7 @@ public class TemplateSearchController {
@OptionalLog(module = "修改",methods = "病案查询页面病案锁定")
@RequestMapping("updateLockByPatientId")
@ResponseBody
public ResultUtil updateLockByPatientId(String patientId,HttpServletRequest request){
try{
public ResultUtil updateLockByPatientId(String patientId,HttpServletRequest request) throws Exception{
if(StringUtils.isNoneBlank(patientId)){
Emr_Lock lock = lockMapper.selectLockByPatientId(patientId,1);
if(null != lock){
@ -1479,10 +1428,6 @@ public class TemplateSearchController {
}else{
return null;
}
}catch(Exception e){
e.printStackTrace();
return null;
}
}
/**
@ -1501,17 +1446,12 @@ public class TemplateSearchController {
@OptionalLog(module = "批量修改",methods = "病案查询页面病案锁定")
@RequestMapping("updateLockByPatientIds")
@ResponseBody
public ResultUtil updateLockByPatientIds(String patientIds,HttpServletRequest request){
try{
public ResultUtil updateLockByPatientIds(String patientIds,HttpServletRequest request) throws Exception{
if(StringUtils.isNoneBlank(patientIds)){
lockService.udpateUnlockByPatients(patientIds,request);
return ResultUtil.ok();
}else{
return null;
}
}catch(Exception e){
e.printStackTrace();
return null;
}
}
}

@ -4,7 +4,6 @@ import com.emr.vo.commomSearch.CommomTree;
import com.emr.vo.commomSearch.CommomVo;
import com.emr.vo.FontVo.FontCommom;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@ -61,7 +60,7 @@ public interface CommomMapper {
/**
* isExistInpatient
* */
int isExistInpatient(FontCommom record);
List<FontCommom> isExistInpatient(FontCommom record);
int insertSelective(CommomVo record);

@ -12,6 +12,7 @@ import com.emr.service.tScanAssort.T_Scan_AssortService;
import com.emr.util.UUIDUtils;
import com.emr.util.img2PdfUtil;
import com.emr.vo.FontVo.ScanAssortVo;
import com.emr.vo.Msg;
import com.emr.vo.User;
import com.emr.vo.commomSearch.CommomBlood;
import com.emr.vo.commomSearch.CommomVo;
@ -25,16 +26,17 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.MultiValueMap;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.*;
/**
* @ProjectName:
@ -98,6 +100,12 @@ public class CommomService {
return userIds;
}
/**
* admin
* @param userName
* @param request
* @return
*/
public List<User> getUserList(String userName,HttpServletRequest request){
List<User> userList = new ArrayList<>();
try {
@ -130,60 +138,39 @@ public class CommomService {
return userList;
}
public String updatePic(MultipartFile[] files, String patientId, String assortId) throws Exception{
/**
*
* @param files
* @param patientId
* @param assortId
* @return
* @throws Exception
*/
public ResultUtil updatePic(MultipartFile[] files, String patientId, String assortId) throws Exception {
if (null != files) {
//查询目录
CommomVo commomVo = commomMapper.selectByPrimaryKey(patientId);
String path = commomVo.getNewPath();
//不存在的话,组织存放目录
if(StringUtils.isBlank(path)){
//查询设置的根目录
EmrComomSet emrComomSet = commomSetService.selectByPrimaryKey(1);
String newPicRoot = emrComomSet.getNewPicRoot();
if(StringUtils.isBlank(newPicRoot)){
return "目录未设置,请先前往参数设置页面设置图片存在根目录!";
}
//组织存放目录
//D:\新图像\202005\GDZT20120916076-2a41fe252a024978af7098afcf52ca1a
//格式化年月
SimpleDateFormat fmt = new SimpleDateFormat("yyyyMM");
path = newPicRoot + "/" + fmt.format(new Date()) + "/" + commomVo.getInpatientNo() + "-" + patientId;
ResultUtil resultUtil = selectRootPath(patientId, commomVo.getInpatientNo());
if (resultUtil.getCode().equals(0)) {
String path = resultUtil.getMsg();
//保存至commomtable表
commomVo.setNewPath(path);
commomMapper.updateByPrimaryKeySelective(commomVo);
}
//该目录不存在,创建目录
if(!new File(path).isDirectory()){
new File(path).mkdirs();
}
SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHHmmssSSS");
List<MultipartFile> fileList = CollectionUtils.arrayToList(files);
//定义批量添加进图片明细表集合
List<T_Scan_Assort> insertList = new ArrayList<>();
for (int i = 0; i < files.length; i++) {
String fullName = files[i].getOriginalFilename();
String src = path + "/" + fullName;
File file = new File(src);
//判断是否存在,存在文件加日期
if (file.exists()) {
//原始名
String baseName = FilenameUtils.getBaseName(files[i].getOriginalFilename());
//扩展名
String ext = FilenameUtils.getExtension(files[i].getOriginalFilename());
fullName = baseName + "_" + fmt.format(new Date()) + "." + ext;
List<T_Scan_Assort> insertList = getScanAssortListByUpdatePic(fileList, patientId, assortId, path);
//批量新增图片记录
scanAssortService.SimpleInsert(insertList);
return ResultUtil.ok();
} else {
return resultUtil;
}
src = path + "/" + fullName;
//上传图片
files[i].transferTo(new File(src));
T_Scan_Assort scanAssort = new T_Scan_Assort();
scanAssort.setPatientId(patientId);
scanAssort.setAssortId(assortId);
scanAssort.setScanPage(fullName);
scanAssort.setSource(Short.valueOf("2"));
insertList.add(scanAssort);
}
scanAssortService.SimpleInsert(insertList);
return null;
}
//脐血库显示pdf
public void showRecordContentBlood(String patientId, String scanPages, String sources, String flag, HttpServletResponse response) throws Exception{
String pdfName = "档案管理PDF";
if (StringUtils.isNotBlank(patientId)) {
@ -230,16 +217,23 @@ public class CommomService {
}
}
/**
*
* @param commomVo
*/
public void updateRecordReMark(CommomVo commomVo){
commomMapper.updateRecordReMark(commomVo);
}
/**
*
* @param commomBlood
*/
public String addRecordBlood(CommomBlood commomBlood) {
public ResultUtil addRecordBlood(CommomBlood commomBlood, HttpServletRequest request) throws Exception{
//获取patientId
String patientId = UUIDUtils.getUUID();
//复制到commomVo
CommomVo commomVo = new CommomVo();
BeanUtils.copyProperties(commomBlood,commomVo);
//生成patientId
String patientId = UUIDUtils.getUUID();
commomVo.setPatientId(patientId);
//设置创建时间到dis_date
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@ -247,16 +241,75 @@ public class CommomService {
//设置初始化is_oper=1
commomVo.setIsOper("1");
//设置图片根目录
//selectRootPath(patientId,)
//保存至commomtable表
//commomVo.setNewPath(path);
ResultUtil resultUtil = selectRootPath(patientId, commomBlood.getInpatientNo());
String root = "";
if(resultUtil.getCode().equals(0)){
root = resultUtil.getMsg();
commomVo.setNewPath(root);
}else{
return resultUtil;
}
//批量上传图片
List<T_Scan_Assort> scanAssorts = addRecordUpdatePic(patientId, root, request);
//新增
commomMapper.insertSelective(commomVo);
return null;
//批量新增图片记录
scanAssortService.SimpleInsert(scanAssorts);
return ResultUtil.ok();
}
//新增档案时图片返回图片记录方法
private List<T_Scan_Assort> addRecordUpdatePic(String patientId,String root,HttpServletRequest request) throws Exception{
//获取文件上下文
CommonsMultipartResolver multipartResolver=new CommonsMultipartResolver(
request.getSession().getServletContext());
//定义图片集合
List<T_Scan_Assort> scanAssorts = new ArrayList<>();
// 判断是否是多数据段提交格式
if (multipartResolver.isMultipart(request)) {
//获取文件request
MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest)request;
//获取图片Map
MultiValueMap<String, MultipartFile> multiFileMap = multiRequest.getMultiFileMap();
//取出图片map集合
Set<String> keySet = multiFileMap.keySet();
//遍历图片map
for (String assortId : keySet) {
//获取分类图片集合
List<MultipartFile> multipartFiles = multiFileMap.get(assortId);
scanAssorts.addAll(getScanAssortListByUpdatePic(multipartFiles,patientId,assortId,root));
}
}
return scanAssorts;
}
//封装批量上传图片,返回上传图片记录
private List<T_Scan_Assort> getScanAssortListByUpdatePic(List<MultipartFile> multipartFiles,String patientId,String assortId,String root) throws Exception{
List<T_Scan_Assort> scanAssorts = new ArrayList<>();
//遍历分类图片集合
for(MultipartFile pic : multipartFiles){
//定义对象
T_Scan_Assort scanAssort = new T_Scan_Assort();
String picName = pic.getOriginalFilename();
//判断图片名称是否存在,存在重命名
picName = getPicName(root, picName, pic);
//组织绝对路径
String src = root + "\\" + picName;
//上传图片
pic.transferTo(new File(src));
//设置进对象
scanAssort.setPatientId(patientId);
scanAssort.setAssortId(assortId);
scanAssort.setScanPage(picName);
scanAssort.setSource(Short.valueOf("2"));
scanAssort.setIsDel(Short.valueOf("0"));
scanAssorts.add(scanAssort);
}
return scanAssorts;
}
//封装组织新增图片根目录
public ResultUtil selectRootPath(String patientId,String inpatientId){
private ResultUtil selectRootPath(String patientId,String inpatientId){
//查询设置的根目录
EmrComomSet emrComomSet = commomSetService.selectByPrimaryKey(1);
String newPicRoot = emrComomSet.getNewPicRoot();
@ -267,6 +320,46 @@ public class CommomService {
//D:\新图像\202005\GDZT20120916076-2a41fe252a024978af7098afcf52ca1a
//格式化年月
SimpleDateFormat fmt1 = new SimpleDateFormat("yyyyMM");
return ResultUtil.ok(newPicRoot + "/" + fmt1.format(new Date()) + "/" + inpatientId + "-" + patientId);
String path = newPicRoot + "\\" + fmt1.format(new Date()) + "\\" + inpatientId + "-" + patientId;
//该目录不存在,创建目录
if (!new File(path).isDirectory()) {
new File(path).mkdirs();
}
return ResultUtil.ok(path);
}
//验证图片是否存在,存在重命名
private String getPicName(String root,String fullName,MultipartFile pic){
SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHHmmssSSS");
String src = root + "\\" + fullName;
File file = new File(src);
//判断是否存在,存在文件加日期
if (file.exists()) {
//原始名
String baseName = FilenameUtils.getBaseName(pic.getOriginalFilename());
//扩展名
String ext = FilenameUtils.getExtension(pic.getOriginalFilename());
fullName = baseName + "_" + fmt.format(new Date()) + "." + ext;
}
return fullName;
}
/**
*
* @param commomVo
*/
public void updateRecord(CommomVo commomVo){
commomMapper.updateByPrimaryKeySelective(commomVo);
}
/**
*
* @param patientId
*/
public void deleteRecord(String patientId){
//删除操作修改isOper的状态为-1
CommomVo commomVo = new CommomVo();
commomVo.setPatientId(patientId);
commomVo.setIsOper("-1");
commomMapper.updateRecordReMark(commomVo);
}
}

@ -55,7 +55,7 @@ public class EmrLockServiceImpl{
int simpleInsertCount = 2100/colCount;
for (int i = 0; i < commomtables.size(); i++) {
//处理批量添加sql太长问题设定个数为180
if(null != list && i > 0 && list.size()%simpleInsertCount == 0){
if(i != 0 && list.size()%simpleInsertCount == 0){
list.clear();
}
Emr_Lock lock = new Emr_Lock();
@ -72,7 +72,7 @@ public class EmrLockServiceImpl{
lock.setLockState(1);
list.add(lock);
//是180的倍数或最后一个
if(null != list && (list.size()%simpleInsertCount == 0 || i == commomtables.size() - 1)){
if(list.size()%simpleInsertCount == 0 || i == commomtables.size() - 1){
lockMapper.SimpleInsert(list);
}
}

@ -11,7 +11,7 @@ public interface T_Scan_AssortService {
int SimpleUpdate(String patientId,String assortId,List<String> list);
int SimpleUpdateByPatientIdAndScanPages(String patientId,String newAssortId,String scanPages);
int SimpleDelByPatientIdAndScanPages(String patientId,String scanPages);
int SimpleInsert(List<T_Scan_Assort> list);
void SimpleInsert(List<T_Scan_Assort> list);
List<ScanAssortVo> selectPicPaths(String patientId,String scanPages,String flag);

@ -1,13 +1,18 @@
package com.emr.service.tScanAssort;
import com.emr.dao.CommomMapper;
import com.emr.dao.tScanAssort.T_Scan_AssortMapper;
import com.emr.entity.recordLock.Emr_Lock;
import com.emr.entity.tScanAssort.T_Scan_Assort;
import com.emr.vo.FontVo.ScanAssortVo;
import com.emr.vo.commomSearch.CommomVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
@ -27,6 +32,8 @@ import java.util.List;
public class T_Scan_AssortServiceImpl implements T_Scan_AssortService{
@Autowired
private T_Scan_AssortMapper scanAssortMapper;
@Autowired
private CommomMapper commomMapper;
@Override
public void updateByPrimaryKeySelective(T_Scan_Assort newAssort, T_Scan_Assort oldAssort) {
scanAssortMapper.updateByPrimaryKeySelective(newAssort,oldAssort);
@ -48,8 +55,25 @@ public class T_Scan_AssortServiceImpl implements T_Scan_AssortService{
}
@Override
public int SimpleInsert(List<T_Scan_Assort> list) {
return scanAssortMapper.SimpleInsert(list);
public void SimpleInsert(List<T_Scan_Assort> list) {
if(!CollectionUtils.isEmpty(list)) {
//根据字段多少批量新增
///查询表列数
int colCount = commomMapper.selectColByTableName("t_scan_assort");
int simpleInsertCount = 2100 / colCount;
List<T_Scan_Assort> scanAssorts = new ArrayList<>();
for (int i = 0; i < list.size(); i++) {
//处理批量添加sql太长问题设定个数为180
if (i != 0 && list.size() % simpleInsertCount == 0) {
scanAssorts.clear();
}
scanAssorts.add(list.get(i));
//是180的倍数或最后一个
if (list.size() % simpleInsertCount == 0 || i == list.size() - 1) {
scanAssortMapper.SimpleInsert(scanAssorts);
}
}
}
}
@Override

@ -19,6 +19,8 @@ import javax.validation.constraints.NotBlank;
*/
@Data
public class CommomBlood {
private String patientId;
@NotBlank(message = "脐血编号不能为空")
@Length(max = 15,message = "字符不能超过15个字符")
private String inpatientNo;//脐血编号

@ -143,6 +143,10 @@ public class CommomVo {
private Integer lockStatus=0;//锁定状态
private Integer editOper=0;//可修改
private Integer delOper=0;//可删除
private String diagCode;//诊断编号
private String diagName;//诊断名称
@ -1882,4 +1886,20 @@ public class CommomVo {
public void setIsDownload(Integer isDownload) {
this.isDownload = isDownload;
}
public Integer getEditOper() {
return editOper;
}
public void setEditOper(Integer editOper) {
this.editOper = editOper;
}
public Integer getDelOper() {
return delOper;
}
public void setDelOper(Integer delOper) {
this.delOper = delOper;
}
}

@ -532,6 +532,9 @@
<if test="mainDiagCode != null">
main_diag_code,
</if>
<if test="newPath != null">
new_path,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="patientId != null">
@ -594,6 +597,9 @@
<if test="mainDiagCode != null">
#{mainDiagCode,jdbcType=NVARCHAR},
</if>
<if test="newPath != null">
#{newPath,jdbcType=NVARCHAR},
</if>
</trim>
</insert>
@ -658,6 +664,9 @@
<if test="newPath != null">
new_path = #{newPath,jdbcType=NVARCHAR},
</if>
<if test="mainDiagCode != null">
main_diag_code = #{mainDiagCode,jdbcType=NVARCHAR},
</if>
</set>
where patient_id = #{patientId,jdbcType=VARCHAR}
</update>
@ -1187,9 +1196,9 @@
</where>
</select>
<!--根据条件查询该病案是否存在-->
<select id="isExistInpatient" resultType="java.lang.Integer">
<select id="isExistInpatient" resultMap="BaseResultMap2">
SELECT
count(1)
*
FROM
commomtable
LEFT JOIN
@ -1197,6 +1206,7 @@
ON
commomtable.patient_id = commomtable1.patient_id
<where>
commomtable.is_oper != -1
<if test="patientId != null and patientId != ''">
AND commomtable.patient_id = #{patientId}
</if>
@ -1259,8 +1269,16 @@
AS commom
</select>
<!--修改病案备注-->
<update id="updateRecordReMark">
update commomtable set memo = #{memo}
<update id="updateRecordReMark" parameterType="com.emr.vo.commomSearch.CommomVo">
update commomtable
<set>
<if test="memo != null and memo != ''">
memo = #{memo},
</if>
<if test="isOper != null and isOper != ''">
is_oper = #{isOper},
</if>
</set>
where patient_id = #{patientId}
</update>
</mapper>

@ -204,4 +204,8 @@
update t_scan_assort set is_del = 0 where patient_id = #{patientId}
and scan_page in (${scanPages})
</update>
<!--根据patientId删除图片集合-->
<delete id="deletePicByPatientId">
delete from t_scan_assort where patient_id = #{patientId}
</delete>
</mapper>

@ -26,10 +26,10 @@
.searchDiv{
padding-top:5px;
height:30px;
text-align: right;
}
.searchInput{
width: 18%;
margin-left: 18px;
}
.searchElement{
width: 34%;
@ -52,7 +52,6 @@
}
/**表格div*/
.tableDiv{
padding-top:15px;
margin-left:1%;
}
/***模态1*/
@ -111,7 +110,7 @@
<div class="searchDiv">
<input type="hidden" id="treeId">
<form id="searchForm">
<div class="searchInput left">
<div class="searchInput left" style="margin-left: -34px;">
<div class="searchElement left">
<label class="labelDiv">类别:</label>
</div>
@ -147,7 +146,7 @@
</select>
</div>
</div>
<div class="searchInput left" style="margin-left: 10px">
<div class="left" style="margin-left: 10px">
<button type="button" class="btn btn-sm btn-primary" onclick="refreshTable()">查询</button>
</div>
</form>

@ -28,23 +28,22 @@
}
.mainDiv{
background-color: #fff;
height:100%;
}
/**搜索区*/
.searchDiv{
padding-top:5px;
height: 30px;
text-align: right;
}
.searchDiv1{
margin-top: 10px;
height: 30px;
text-align: right;
}
.tableDiv{
width: 100%;
height: 100%;
background-color: #fff;
margin-left: 1%;
padding-top:5px;
}
.dateSearchDiv{
width:29%;
@ -201,7 +200,7 @@
</select>
</div>
</div>
<div class="searchInput left" style="margin-left: 2%">
<div class="left" style="margin-left: 2%">
<button type="button" class="btn btn-sm btn-primary" onclick="refreshTable()">查询</button>
</div>
</div>

@ -27,20 +27,20 @@
}
.mainDiv{
background-color: #fff;
height:100%;
}
/**搜索区*/
.searchDiv{
padding-top:1%;
height: 30px;
text-align: right;
}
.searchDiv1{
padding-top:2%;
height: 30px;
text-align: right;
}
.tableDiv{
width:100%;
height:100%;
background-color: #fff;
margin-left: 1%;
}
@ -71,16 +71,10 @@
}
/**查询按钮组*/
.btnsDiv{
height:5%;
height:30px;
}
.btn{
margin-right:3%;
margin-left: 2%;
}
.btns{
float:right;
margin-right:3%;
margin-bottom: 1%;
}
.pagination{
margin:0!important;
@ -185,7 +179,7 @@
<button id="addApprovesMore" type="button" class="btn btn-sm btn-warning btnl" onclick="addApprovesMore()"> + 批量审批</button>
</shiro:hasPermission>
<shiro:hasPermission name="/approve/exportExcelApproveList">
<button type="button" class="btn btn-sm btn-primary btns" onclick="exportExcel()"><i class="fa fa-reply"></i>导出</button>
<button type="button" class="btn btn-sm btn-primary" onclick="exportExcel()"><i class="fa fa-reply"></i>导出</button>
</shiro:hasPermission>
</div>
</div>

@ -33,16 +33,17 @@
/**搜索区*/
.mainDiv{
background-color: #fff;
height:100%;
}
.searchDiv{
padding-top:5px;
height:30px;
text-align: right;
}
.searchDiv1{
margin-top: 10px;
margin-left: 14px;
height:30px;
text-align: right;
}
/**查询按钮组*/
.btnsDiv{
@ -62,7 +63,7 @@
}
.dateSearchInput{
width:37%;
margin-left:3%;
margin-left:5px;
}
.dateLabelDiv{
width: 20%;
@ -87,12 +88,11 @@
/**搜索按钮div*/
.searchBtnDiv{
float:left;
margin-left: 20px;
margin-left: 74px;
height:15px;
}
#tableDiv{
margin-left:15px;
margin-top:10px;
}
/***模态1*/
.line1{
@ -169,7 +169,7 @@
<div class="dateLabelDiv left">
<label class="labelDiv">收藏日期:</label>
</div>
<div class="dateSearchInput left">
<div class="dateSearchInput left" style="margin-left: 5px">
<input type="text" class="form-control input-sm" id="startTime1" placeholder="开始时间" maxlength="10">
</div>
<div class="dateSearchInput left">
@ -194,7 +194,7 @@
<input type="text" class="form-control input-sm" id="searchName" maxlength="16">
</div>
</div>
<div class="searchInput left" style="margin-left: 13px">
<div class="searchInput left" style="margin-left: 54px">
<div class="searchElement left">
<label class="labelDiv">收藏类别:</label>
</div>

@ -96,6 +96,15 @@
</div>
<!--搜索区-->
<div class="col-md-9 rightDiv">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">角色调阅配置</a></li>
<li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">类别管理</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="home">
<iframe style="width:100%;height:calc(100% - 43px)" frameborder="no" border="0" name="iframe" id="iframe"></iframe>
</div>
<div role="tabpanel" class="tab-pane fade" id="profile" style="height:calc(100% - 52px)">
<div class="row searcDiv">
<div class="col-sm-5">
<div class="form-group">
@ -138,7 +147,8 @@
<table id="mytab" class="table text-nowrap table-bordered">
</table>
</div>
<iframe style="width:100%;height:calc(100% - 395px)" frameborder="no" border="0" name="iframe" id="iframe"></iframe>
</div>
</div>
</div>
</div>
<!-- 模态框1Modal添加、编辑 -->

@ -98,8 +98,8 @@
<!--搜索区-->
<div class="col-md-9 rightDiv">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">用户调阅权限配置</a></li>
<li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">权限管理</a></li>
<li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">用户调阅配置</a></li>
<li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">类别管理</a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="home">

@ -33,7 +33,7 @@
}
.dateSearchInput{
width:30%;
margin-left:2%;
margin-left:5px;
}
.dateLabelDiv{
width: 30%;
@ -42,6 +42,7 @@
.searchInput{
width:21%;
margin-left: 5px;
text-align: right;
}
.searchElement{
width:40%;

@ -26,7 +26,6 @@
/**搜索区*/
.mainDiv{
background-color: #fff;
height:100%;
}
.searchDiv{
padding-top:10px;
@ -44,6 +43,7 @@
margin-left: 10%;
}
.dateSearchDiv{
text-align: right;
width:34%;
}
.dateSearchInput{
@ -55,6 +55,7 @@
}
/*搜索区域*/
.searchInput{
text-align: right;
width:18%;
}
/*搜索区域labelDiv*/
@ -71,7 +72,6 @@
}
#tableDiv{
margin-left:12px;
margin-top:5px;
}
.pagination{
margin:0!important;

@ -21,24 +21,15 @@
<script type="text/javascript" src="${path}/static/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="${path}/static/js/respond.min.js"></script>
<![endif]-->
<script type="text/javascript" src="${path}/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.js?time=2019-12-25"></script>
<script type="text/javascript" src="${path}/static/js/udpatePic/imgUp.js"></script>
<script>
var path = "${path}";
</script>
<style type="text/css">
body {
margin-right: -15px;
margin-bottom: -15px;
}
.labelDiv{
padding-top: 2%;
padding-right: 0;
text-align: right;
}
.radioDiv{
padding-top: 2%;
}
/*搜索区域*/
.panel-group{
margin-bottom: 0!important;
@ -48,8 +39,11 @@
width:100%;
background-color: #fff;
text-align: right;
margin-top:5px;
margin-bottom: 5px;
margin:5px 0px 5px 0px;
}
.tableBtn{
margin-left:5px;
}
/*tableDiv*/
.tableDiv{
@ -78,38 +72,15 @@
font-family: "Segoe UI", Helvetica, Arial, sans-serif;
border: 1px solid #ddd;
}
.TableView{
margin-left:2%;
}
.pagination{
margin:0!important;
}
.form-group{
width:110%;
}
/**级联病案号内容*/
.mouseOver{
background-color: #708090;
color:#FFFAFA;
}
.mouseOut{
background-color: #FFFAFA;
color:#000000;
}
/*模态框头*/
.modal-header{
background-color: #199ED8;
text-align: center;
}
/*搜索按钮div*/
.searchDiv{
margin-left: 33px;
}
/*清空按钮div*/
.clearDiv{
margin-left: 16px;
}
.col-sm-1,.col-sm-4{
padding-left: 0!important;
}
@ -121,18 +92,6 @@
.table-hover > tbody > tr:hover > th {
cursor: pointer;
}
/**固定列样式*/
.fixed-table-body-columns{
top:391px!important;
/*height:226px!important;*/
}
.fht-cell{width:18px!important;}
.inputValue{
margin-top: 2px;
}
.detail{
width:30px;
}
.panel-body {
padding: 15px 0 0 0;
}
@ -439,7 +398,7 @@
<div class="form-group">
<label class="col-sm-4 control-label">脐血编号:</label>
<div class="col-sm-7">
<input type="text" name="inpatientNo" id="inpatientNo" class="form-control input-sm input" maxlength="15"/>
<input type="text" name="inpatientNo" id="inpatientNo" class="form-control input-sm input" maxlength="25"/>
</div>
<div class="col-sm-1"></div>
</div>
@ -448,7 +407,7 @@
<div class="form-group">
<label class="col-sm-4 control-label">协议号:</label>
<div class="col-sm-7">
<input type="text" class="form-control input-sm input" name="admissId" id="admissId" maxlength="15"/>
<input type="text" class="form-control input-sm input" name="admissId" id="admissId" maxlength="25"/>
</div>
<div class="col-sm-1"></div>
</div>
@ -488,7 +447,7 @@
<div class="form-group">
<label class="col-sm-4 control-label">身份证号:</label>
<div class="col-sm-7">
<input type="text" class="form-control input-sm input" id="main_dis_thing1" name="mainDisThing" maxlength="10"/>
<input type="text" class="form-control input-sm input" id="main_dis_thing1" name="mainDisThing" maxlength="25"/>
</div>
<div class="col-sm-1"></div>
</div>
@ -505,13 +464,14 @@
</div>
<!--右侧分类图片-->
<div class="col-sm-9">
<div class="img-box full">
<section class="img-section">
<div class="img-box full" id="assortImgDiv">
<section class="img-section" id="img">
<div class="z_photo upimg-div clear" >
<section class="z_file fl">
<%--<section class="z_file fl">
<img src="${path}/static/img/a11.png" class="add-img">
<input type="file" name="file" id="file" class="file" value="" accept="image/jpg,image/jpeg,image/png,image/bmp" multiple />
</section>
<input type="hidden" class="assortIdInput" value="2222222222222">
</section>--%>
</div>
</section>
</div>
@ -525,8 +485,6 @@
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-default" onclick="$('#addRecordForm')[0].reset()">清空
</button>
@ -534,6 +492,96 @@
确认提交
</button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- 模态框2Modal新建档案 -->
<div class="modal fade" id="myModal3" tabindex="-1" role="dialog" data-target=".bs-example-modal-lg" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content addRecordModal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title" style="font-weight: bold">
修改档案
</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form" id="editRecordForm" enctype="multipart/form-data">
<input type="hidden" name="patientId" id="patientId1">
<input type="hidden" id="rowIndex">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">脐血编号:</label>
<div class="col-sm-7">
<input type="text" name="inpatientNo" id="inpatientNo2" class="form-control input-sm input" maxlength="15"/>
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">协议号:</label>
<div class="col-sm-7">
<input type="text" class="form-control input-sm input" name="admissId" id="admissId2" maxlength="15"/>
</div>
<div class="col-sm-1"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">产妇姓名:</label>
<div class="col-sm-7">
<input type="text" class="form-control input-sm input" id="name2" name="name" maxlength="30"/>
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">协议类型:</label>
<div class="col-sm-7">
<select class="input-sm input form-control" id="main_diag_name2" name="mainDiagName"></select>
</div>
<div class="col-sm-1"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">脐血状态:</label>
<div class="col-sm-7">
<select class="input-sm input form-control" id="main_diag_code2" name="mainDiagCode"></select>
</div>
<div class="col-sm-1"></div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-4 control-label">身份证号:</label>
<div class="col-sm-7">
<input type="text" class="form-control input-sm input" id="main_dis_thing2" name="mainDisThing" maxlength="25"/>
</div>
<div class="col-sm-1"></div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-sm btn-default" onclick="backFormData()">还原
</button>
<button type="button" class="btn btn-sm btn-primary" onclick="updateRecordBlood()">
确认提交
</button>
</div>
</form>
</div>
</div>
</div>
</div>
@ -542,6 +590,8 @@
$(".modal-dialog").draggable();//为模态对话框添加拖拽
})
</script>
<script type="text/javascript" src="${path}/static/bootstrap-3.3.7/bootstrap-table-fixed-columns.js?time=2019-12-25"></script>
<script type="text/javascript" src="${path}/static/js/recordManage/commomSearch/addRecordImgUp.js"></script>
<script type="text/javascript" src="${path}/static/js/recordManage/commomSearch/commomListBlood.js?t=1"></script>
<script type="text/javascript" src="${path}/static/js/recordManage/templateSearch/searchCommomMethodBlood.js?t=2019-11-20"></script>
<script type="text/javascript" src="${path}/static/js/dateUtil.js"></script>

@ -47,6 +47,7 @@
<input type="hidden" id="patientId" value="${patientId}">
<input type="hidden" id="assortIds">
<input type="hidden" id="sources">
<input type="hidden" id="flag" value="home_addr">
<!--是否有打印权限-->
<input type="hidden" id="print" value="${printFlag}">
<!--文件路径-->

@ -9,9 +9,9 @@ $('#mytab').bootstrapTable({
paginationPreText : '上一页',
paginationNextText : '下一页',
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 5, //每页的记录行数(*
pageSize: 10, //每页的记录行数(*
pageList: [5,10,15,20,30,50],//可供选择的每页的行数(*
height: 320, //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
height: window.innerHeight - 155, //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
columns:[
{
title:'全选',

@ -25,7 +25,6 @@ $("#parentId").change(function(){
})
//加载数据表格
$('#mytab').bootstrapTable({
height:5000,
toolbar: '#toolbar', //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存默认为true所以一般情况下需要设置一下这个属性*

@ -44,7 +44,6 @@ $("#parentId5").change(function(){
})
//加载数据表格
$('#mytab').bootstrapTable({
height:5000,
toolbar: '#toolbar', //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存默认为true所以一般情况下需要设置一下这个属性*
@ -53,9 +52,9 @@ $('#mytab').bootstrapTable({
paginationPreText : '上一页',
paginationNextText : '下一页',
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 5, //每页的记录行数(*
pageSize: 10, //每页的记录行数(*
pageList: [5,10,15,20,30,50],//可供选择的每页的行数(*
height: 320, //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
height: window.innerHeight - 155, //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
columns:[
{
title:'全选',

@ -17,7 +17,6 @@ $("#parentId").change(function(){
}
})
$('#mytab').bootstrapTable({
height:$(window).height,
toolbar: '#toolbar', //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存默认为true所以一般情况下需要设置一下这个属性*
@ -26,9 +25,9 @@ $('#mytab').bootstrapTable({
paginationPreText : '上一页',
paginationNextText : '下一页',
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 5, //每页的记录行数(*
pageSize: 10, //每页的记录行数(*
pageList: [5,10,15,20,30,50],//可供选择的每页的行数(*
height: 320, //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
height: window.innerHeight - 155, //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
columns:[
{
title:'全选',

@ -8,9 +8,9 @@ $('#mytab').bootstrapTable({
paginationPreText : '上一页',
paginationNextText : '下一页',
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 5, //每页的记录行数(*
pageSize: 10, //每页的记录行数(*
pageList: [5,10,15,20,30,50],//可供选择的每页的行数(*
height: 320, //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
height: window.innerHeight - 190, //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
columns:[
{
title:'全选',

@ -33,7 +33,7 @@ $('#mytab').bootstrapTable({
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*
pageList: [5,10,15,20,50,1000],//可供选择的每页的行数(*
height: 1100, //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
height: 550, //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
columns:[
{
title:'全选',
@ -74,7 +74,7 @@ $('#mytab').bootstrapTable({
},
{
title:'文件名',
field:'scanAddr',
field:'scanPage',
},
{
title:'用途',

@ -37,7 +37,7 @@ $('#mytab').bootstrapTable({
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*
pageList: [5,10,15,20,30,50],//可供选择的每页的行数(*
height: 1100, //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
height: window.innerHeight-155, //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
columns:[
{
title:'全选',

@ -0,0 +1,60 @@
var formData = new FormData();
var defaults = {
fileType : ["jpg","png","bmp","jpeg"], // 上传文件的类型
fileSize : 1024 * 1024 * 10 // 上传文件的大小 10M
};
$(function(){
var delParent;
$(".z_photo").delegate(".close-upimg","click",function(){
$(".works-mask").show();
delParent = $(this).parent();
});
//删除确认
$(".wsdel-ok").click(function(){
$(".works-mask").hide();
//获取删除的所属分类id
var assortId = $(this).parents(".works-mask").prev().find("input[class='assortIdInput']").val()
//获取删除的该文件名
var filename = delParent.prevObject.attr("data-filename");
delParent.remove();
//取出该分类的formData
var img1 = formData.getAll(assortId);
//将整个分类删除
formData.delete(assortId);
//重新添加
for(var j=0;j<img1.length;j++){
if(img1[j].name != filename){
formData.append(assortId,img1[j]);
}
}
});
$(".wsdel-no").click(function(){
$(".works-mask").hide();
});
})
function validateUp(files){
var arrFiles = [];//替换的文件数组
for(var i = 0, file; file = files[i]; i++){
//获取文件上传的后缀名
var newStr = file.name.split("").reverse().join("");
if(newStr.split(".")[0] != null){
var type = newStr.split(".")[0].split("").reverse().join("");
if(jQuery.inArray(type, defaults.fileType) > -1){
// 类型符合,可以上传
if (file.size >= defaults.fileSize) {
alert(file.size);
alert('您这个"'+ file.name +'"文件大小过大');
} else {
// 在这里需要判断当前所有文件中
arrFiles.push(file);
}
}else{
alert('您这个"'+ file.name +'"上传类型不符合');
}
}else{
alert('您这个"'+ file.name +'"没有类型, 无法识别');
}
}
return arrFiles;
}

@ -66,6 +66,8 @@ function loadBloodAndAgree(){
$("#main_diag_name").selectpicker('refresh');
$("#main_diag_code1").append(bloodHtml1);
$("#main_diag_name1").append(agreeHtml1);
$("#main_diag_code2").append(bloodHtml1);
$("#main_diag_name2").append(agreeHtml1);
}else{
toastr.warning("查询协议状态出错了,请联系系统管理员")
}
@ -80,12 +82,12 @@ function getSql(){
var inputValue = getInputValue();
if(inputValue != ''){
//select语句字符串
var selectNames = 'select distinct ' + commomtable + '.patient_id,CASE WHEN emr_apply_approve.id is null THEN 0 ELSE 1 END isShowDetail,CASE WHEN emr_apply_approve1.id is null THEN 0 ELSE 1 END isDownload,CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus,';
var selectNames = 'select distinct ' + commomtable + '.patient_id,commomtable.dis_date,CASE WHEN emr_apply_approve.id is null THEN 0 ELSE 1 END isShowDetail,CASE WHEN emr_apply_approve1.id is null THEN 0 ELSE 1 END isDownload,CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus,';
selectNames += $("#englishFields").val();
//from语句字符串
var fromTableNames = ' from ';
//where语句字符串
var whereNames = ' where ';
var whereNames = ' where is_oper != \'-1\' and ';
//判断是否多表
var tables = false;
$('.otherTable').each(function () {
@ -186,9 +188,9 @@ function getSql(){
fromTableNames += ' left join emr_apply_approve emr_apply_approve1 on ' + commomtable + '.patient_id = emr_apply_approve1.patient_id and emr_apply_approve1.apply_type = 3' +
'and emr_apply_approve1.approve_state = 1 and emr_apply_approve1.effe_time > GETDATE()-1 and emr_apply_approve1.applyer = '+ userName
fromTableNames += ' left join emr_lock on ' + commomtable + '.patient_id = emr_lock.patient_id and emr_lock.lock_state = 1';
if(whereNames != ' where '){
if(whereNames != ' where is_oper != \'-1\' and '){
whereNames = whereNames.substring(0,whereNames.length - 4);
var orderBys = " ORDER BY "+commomtable+".inpatient_no";
var orderBys = " ORDER BY "+commomtable+".dis_date desc";
var sql = selectNames + fromTableNames + whereNames;
$("#sql").val(sql);
$("#orderBys").val(orderBys);
@ -241,7 +243,7 @@ function exportExcel(){
}else {
getSql();
var userName = "'" + $("#userName").val() + "'";
var sql1 = "select commomtable.patient_id,CASE WHEN emr_apply_approve.id is null THEN 0 ELSE 1 END isShowDetail,CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus,commomtable.inpatient_no,commomtable.admiss_id,commomtable.name,commomtable.main_dis_thing,commomtable.main_diag_name,commomtable.main_diag_code from commomtable left join emr_apply_approve on commomtable.patient_id = emr_apply_approve.patient_id and emr_apply_approve.approve_state = 1 and emr_apply_approve.effe_time > GETDATE()-1 and emr_apply_approve.applyer = " +userName+ " left join emr_lock on commomtable.patient_id = emr_lock.patient_id and emr_lock.lock_state = 1";
var sql1 = "select commomtable.patient_id,CASE WHEN emr_apply_approve.id is null THEN 0 ELSE 1 END isShowDetail,CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus,commomtable.inpatient_no,commomtable.admiss_id,commomtable.name,commomtable.main_dis_thing,commomtable.main_diag_name,commomtable.main_diag_code from commomtable left join emr_apply_approve on commomtable.patient_id = emr_apply_approve.patient_id and emr_apply_approve.approve_state = 1 and emr_apply_approve.effe_time > GETDATE()-1 and emr_apply_approve.applyer = " +userName+ " left join emr_lock on commomtable.patient_id = emr_lock.patient_id and emr_lock.lock_state = 1 where commomtable.is_oper != \'-1\'";
var sql = $("#sql").val();
if(sql == ''){
sql = sql1;
@ -254,12 +256,7 @@ function exportExcel(){
if (checks != '') {
//按选择框选择导出
checks = checks.substring(0, checks.length - 1);
var isInputValue = getInputValue();
if(isInputValue == ''){
sql += ' WHERE ' + commomtable + '.patient_id IN (' + checks + ')';
}else{
sql += ' AND ' + commomtable + '.patient_id IN (' + checks + ')';
}
sql += orderBys;
var url = path + "/template/exportExcel";
post(url, {"sql": sql, "tableThNames": tableThNames, "fieldCns": fieldCns});
@ -417,9 +414,67 @@ $('#myModal2').on('hide.bs.modal', function () {
//新建档案按钮
function addRecord(){
setFormToken();
$("#patientId").val("");
$("#patientId1").val("");
menu.loadMenuTree();
}
//验证编号是否存在
$("#inpatientNo").blur(function(){
var value = $(this).val();
if(value != ''){
validExistForm('inpatientNo','inpatientNo','脐血编号');
}
})
//验证协议是否存在
$("#admissId").blur(function(){
var value = $(this).val();
if(value != ''){
validExistForm('admissId','admissId','协议号');
}
})
//验证编号是否存在
$("#inpatientNo2").blur(function(){
var value = $(this).val();
if(value != ''){
validExistForm('inpatientNo2','inpatientNo','脐血编号');
}
})
//验证协议是否存在
$("#admissId2").blur(function(){
var value = $(this).val();
if(value != ''){
validExistForm('admissId2','admissId','协议号');
}
})
//封装验证方法
/**
*
* @param inputId 输入框id
* @param value 输入框的值
* @param field 验证字段
* @param fieldCnName 返回已存在信息的区别名称
*/
function validExistForm(inputId,field,fieldCnName){
$.ajax({
type:'get',
url:path+'/commom/validExistForm?'+field+"="+$("#"+inputId).val()+"&patientId="+$("#patientId1").val(),
dataType:'json',
success:function(data){
if(data.code == 0){
//已存在时,返回存在信息
if(data.msg != null){
toastr.warning(fieldCnName+data.msg);
$("#"+inputId).val("");
$("#"+inputId).focus();
}
}else{
toastr.error(data.msg);
}
}
})
}
//验证协议号是否存在
//新建档案确认提交按钮
function addRecordBlood(){
var inpatientNo = $("#inpatientNo").val();
var name = $("#name1").val();
@ -433,14 +488,29 @@ function addRecordBlood(){
$("#name").val("");
$("#name").focus();
}else{
var mainDiagName = $("#main_diag_name1").val();
var mainDiagCode = $("#main_diag_code1").val();
var mainDisThing = $("#main_dis_thing1").val();
formData.append('inpatientNo',inpatientNo);
formData.append('name',name);
formData.append('admissId', $("#admissId").val());
formData.append('mainDiagName',mainDiagName);
formData.append('mainDiagCode',mainDiagCode);
formData.append('mainDisThing',mainDisThing);
$.ajax({
type:'post',
url:path+"/commom/addRecord",
data:$("#addRecordForm").serialize(),
data:formData,
processData: false,
contentType: false,
dataType:'json',
success:function(data){
if(data.code == 0){
$('#myModal').modal("hide");
toastr.success("添加成功");
setTimeout(function(){
window.location.reload();
},500)
}else{
toastr.error(data.msg);
}
@ -449,7 +519,79 @@ function addRecordBlood(){
}
}
}
//树操作
//修改按钮
function editRecordMethod(row){
$("#patientId1").val(row.patientId);
$("#inpatientNo2").val(row.inpatientNo);
$("#admissId2").val(row.admissId);
$("#name2").val(row.name);
$("#main_diag_name2").val(row.mainDiagName);
$("#main_diag_code2").val(row.mainDiagCode);
$("#main_dis_thing2").val(row.mainDisThing);
}
//恢复表单数据
function backFormData(){
var index = $("#rowIndex").val();
editRecordMethod(list[index]);
}
//修改确认提交
function updateRecordBlood() {
var inpatientNo = $("#inpatientNo2").val();
var name = $("#name2").val();
if (inpatientNo == '') {
toastr.warning("脐血编号不能为空");
$("#inpatientNo2").val("");
$("#inpatientNo2").focus();
} else {
if (name == '') {
toastr.warning("孕妇姓名不能为空");
$("#name2").val("");
$("#name2").focus();
} else {
$.ajax({
type: "post",
url: path + "/commom/updateRecordBlood",
dataType: "json",
data: $("#editRecordForm").serialize(),
success: function (data) {
if (data.code == 0) {
toastr.success("修改成功");
reLoadTable();
$('#myModal3').modal('hide');
} else {
toastr.error(data.msg);
}
}
})
}
}
}
//删除档案
function deleteRecordBlood(patientId,name){
Common.confirm({
title: "提示",
message: "请确认是否删除\""+name+"\"的档案,确认请点击确认",
operate: function (reselt) {
if (reselt) {
$.ajax({
type: "post",
url: path + "/commom/deleteRecordBlood",
dataType: "json",
data:{patientId:patientId},
success: function (data) {
if (data.code == 0) {
toastr.success("删除成功");
reLoadTable();
} else {
toastr.error(data.msg);
}
}
})
}
}
})
}
//树操作
var menu = {
setting: {
@ -479,8 +621,66 @@ var menu = {
$.fn.zTree.init($("#ztree"), menu.setting, data);
zTree = $.fn.zTree.getZTreeObj("ztree");
var nodes = zTree.getNodes();
//展开第一个
zTree.expandNode(nodes[0], true, false, true);
var nodes = zTree.transformToArray(zTree.getNodes());
var html = '';
//展开第一个
for(var i = 0;i < nodes.length;i++){
if(nodes.assortId != '0') {
html += '<section class="img-section" id="img' + nodes[i].assortId + '" style="display: none">\n' +
' <div class="z_photo upimg-div clear" >\n' +
' <section class="z_file fl">\n' +
' <img src='+path+'/static/img/a11.png class="add-img">\n' +
' <input type="file" name="file" id="file' + nodes[i].assortId + '" class="file" value="" accept="image/jpg,image/jpeg,image/png,image/bmp" multiple />\n' +
' <input type="hidden" class="assortIdInput" value="' + nodes[i].assortId + '">\n' +
' </section>\n' +
' </div>\n' +
'</section>';
}
}
$("#assortImgDiv").append(html);
/*点击图片的文本框*/
$("input[name=file]").change(function(){
var idFile = $(this).attr("id");
var file = document.getElementById(idFile);
//获取分类id
var assortId = $("#"+idFile).next().val();
var imgContainer = $(this).parents(".z_photo"); //存放图片的父亲元素
var fileList = file.files; //获取的图片文件
var imgArr = [];
//遍历得到的图片文件
fileList = validateUp(fileList);
for(var i = 0;i<fileList.length;i++){
//添加进formData
formData.append(assortId,fileList[i]);
var imgUrl = window.URL.createObjectURL(fileList[i]);
imgArr.push(imgUrl);
var $section = $("<section class='up-section fl loading'>");
imgContainer.prepend($section);
var $span = $("<a href='"+imgArr[i]+"' target='_blank'><span class='up-span' style='cursor:pointer'></a>");
$span.appendTo($section);
var $img0 = $("<img class='close-upimg' data-filename='"+fileList[i].name+"'>").on("click",function(event){
event.preventDefault();
event.stopPropagation();
$(".works-mask").show();
delParent = $(this).parent();
});
$img0.attr("src",path+"/static/img/a7.png").appendTo($section);
var $img = $("<img name='files' class='up-img up-opcity'>");
$img.attr("src",imgArr[i]);
$img.appendTo($section);
var $p = $("<p class='img-name-p'>");
$p.html(fileList[i].name).appendTo($section);
var $input = $("<input id='taglocation' name='taglocation' value='' type='hidden'>");
$input.appendTo($section);
var $input2 = $("<input id='tags' name='tags' value='' type='hidden'/>");
$input2.appendTo($section);
}
setTimeout(function(){
$(".up-section").removeClass("loading");
$(".up-img").removeClass("up-opcity");
},450);
});
}
}
})
@ -489,9 +689,14 @@ var menu = {
//树点击事件
function onClick(e,treeId,treeNode) {
//选中节点时
//图片集合
var scanPageList = treeNode.scanPageList;
var srcs = treeNode.srcs;
var assortNames = treeNode.assortNames;
var level = treeNode.level;
if(level > 0){
$(".img-section").each(function(){
$(this).hide();
})
$("#img"+treeNode.assortId).show();
}else{
toastr.warning("请选中子节点分类!");
}
};
/*********************************新建档案结束********************************/

@ -2,7 +2,7 @@
//TODO 添加需要格式化日期格式的字段
var dateFields = 'disDate,admissDate,birthday,affirmDate';
var pageNumber, showRecord, downloadRecord;
var list=[];
$(function () {
//根据窗口调整表格高度
/*$(window).resize(function() {
@ -132,7 +132,7 @@ function freshTable() {
sql = "select distinct commomtable.patient_id,CASE WHEN emr_apply_approve.id is null THEN 0 ELSE 1 END isShowDetail,CASE WHEN emr_apply_approve1.id is null THEN 0 ELSE 1 END isDownload,CASE WHEN emr_lock.id is null THEN 0 ELSE 1 END lockStatus,commomtable.inpatient_no,commomtable.admiss_id,commomtable.name,commomtable.main_dis_thing,commomtable.main_diag_name,commomtable.main_diag_code from commomtable "
+ "left join emr_apply_approve on commomtable.patient_id = emr_apply_approve.patient_id and emr_apply_approve.apply_type != 3 and emr_apply_approve.approve_state = 1 and emr_apply_approve.effe_time > GETDATE()-1 and emr_apply_approve.applyer = " + userName
+ "left join emr_apply_approve emr_apply_approve1 on commomtable.patient_id = emr_apply_approve1.patient_id and emr_apply_approve1.apply_type = 3 and emr_apply_approve1.approve_state = 1 and emr_apply_approve1.effe_time > GETDATE()-1 and emr_apply_approve1.applyer = " + userName
+ " left join emr_lock on commomtable.patient_id = emr_lock.patient_id and emr_lock.lock_state = 1";
+ " left join emr_lock on commomtable.patient_id = emr_lock.patient_id and emr_lock.lock_state = 1 where commomtable.is_oper != '-1'";
}
var orderBys = $("#orderBys").val();
var flag = $("#showPrint").val();
@ -155,9 +155,9 @@ function freshTable() {
paginationNextText: '下一页',
detailView: flag,
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 5, //每页的记录行数(*
pageSize: 10, //每页的记录行数(*
pageList: [5, 10, 20, 50, 100, 500, 1000],//可供选择的每页的行数(*
height: 400,//高度调整 //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
height: window.innerHeight-220,//高度调整 //行高如果没有设置height属性表格自动根据记录条数觉得表格高度
buttonsAlign: "left",//按钮对齐方式
columns: columns,
locale: 'zh-CN',//中文支持,
@ -174,6 +174,7 @@ function freshTable() {
//在ajax获取到数据渲染表格之前修改数据源
var nres = [];
nres.push({total: res.total, rows: res.list});
list = res.list;
return nres[0];
},
onLoadSuccess: function (res) {
@ -182,6 +183,11 @@ function freshTable() {
$(".fixed-table-body").css("overflow", "auto");
//赋值总数
$("#rows").val(res.total);
$(".updateRecordBtn").click(function(){
var index = $(this).attr('data-index');
editRecordMethod(list[index]);
$("#rowIndex").val(index);
});
/*if(typeof($('.clearfix'))!=='undefined'){
var height = this.$tableBody.height() - 17;
}else{
@ -369,29 +375,41 @@ function AddFunctionAlty(value, row, index) {
var borrowingOper = row.borrowingOper;
var downloadOper = row.downloadOper;
var isDownload = row.isDownload;
var editOper = row.editOper;
var delOper = row.delOper;
var str = '';
if (lockStatus != '' && lockStatus == 1) {
if (unlockOper != '' && unlockOper == 1) {
str += '<button type="button" class="btn btn-success TableView btn-sm" onclick="unlock(' + patientId + ')">解锁</button>';
str += '<button type="button" class="btn btn-xs btn-success btn-sm" onclick="unlock(' + patientId + ')">解锁</button>';
}
} else {
if ((null != isShowDetail && isShowDetail == 1) || showRecord == "1") {
str += '<a type="button" href="' + path + '/commom/showRecordBlood?patientId=' + row.patientId + '" class="btn btn-danger TableView btn-sm" onclick="showDetail(' + patientId + ')" target="_blank">查看详情</a>';
str += '<a type="button" href="' + path + '/commom/showRecordBlood?patientId=' + row.patientId + '" class="btn btn-danger btn-sm" onclick="showDetail(' + patientId + ')" target="_blank">查看详情</a>';
} else {
if (borrowingOper == 1) {
str += '<button type="button" class="btn btn-primary TableView btn-sm" onclick="borrowing(' + patientId + ')" data-toggle="modal" data-target="#myModal1">借阅申请</button>';
str += '<button type="button" class="btn btn-primary btn-sm" onclick="borrowing(' + patientId + ')" data-toggle="modal" data-target="#myModal1">借阅申请</button>';
}
}
//判断可否下载
if (downloadOper == 1) {
if ((null != isDownload && isDownload == 1) || downloadRecord == '1') {
str += '<button type="button" class="btn btn-sm btn-info TableView btn-sm" onclick="downloadPdf(' + patientId + ')">下载PDF</button>';
str += '<button type="button" class="btn btn-sm btn-info btn-sm tableBtn" onclick="downloadPdf(' + patientId + ')">下载PDF</button>';
} else {
str += '<button type="button" class="btn btn-success TableView btn-sm" onclick="downBorrowing(' + patientId + ')" data-toggle="modal" data-target="#myModal1">下载申请</button>';
str += '<button type="button" class="btn btn-success btn-sm tableBtn" onclick="downBorrowing(' + patientId + ')" data-toggle="modal" data-target="#myModal1">下载申请</button>';
}
}
//可编辑
if (editOper == 1) {
str += '<button type="button" data-index="'+index+'" class="btn btn-primary btn-sm updateRecordBtn tableBtn" data-toggle="modal" data-target="#myModal3">修改</button>';
}
//可删除
if (delOper == 1) {
var name = "'" + row.name + "'";
str += '<button type="button" class="btn btn-danger btn-sm tableBtn" onclick="deleteRecordBlood('+patientId+','+name+')">删除</button>';
}
//可锁定
if (lockOper == 1) {
str += '<button type="button" class="btn btn-warning TableView btn-sm" onclick="lock(' + patientId + ')">锁定</button>';
str += '<button type="button" class="btn btn-warning btn-sm tableBtn" onclick="lock(' + patientId + ')">锁定</button>';
}
}
return str;

Loading…
Cancel
Save