master
tan 2 years ago
parent 518d31f7a8
commit ddb4fb18de

@ -21,7 +21,8 @@
"filetitle":"FILENAME",
//
"doctorSubmitTime":"SUBMIT_TIME",
//id
"sealId":"SEAL_ID",
//,&
"downurl":"PDF_PATH",
//
@ -38,6 +39,8 @@
"filestoragetype":1,
//
"uploadConnector":"http://192.9.100.171:9291/api/downplatform/report",
//
"sealUpload":"",
//doubleBasic
"basicDirectory":[""],
//

@ -0,0 +1,32 @@
package com.docus.bgts.entity;
import lombok.Data;
/**
* @description
* @author zhengkai.blog.csdn.net
* @date 2022-08-17
*/
@Data
public class CqcSubmitState {
private static final long serialVersionUID = 1L;
/**
*
*/
private String patientId;
/**
* (0:1)
*/
private Integer doctorState;
/**
*
*/
private Integer nurseState;
}

@ -7,4 +7,10 @@ import lombok.Data;
public class ReportDownPatientDto {
@ApiModelProperty(value = "记帐号")
private String jzh;
@ApiModelProperty(value = "封存id")
private String sealId;
@ApiModelProperty(value = "主键")
private String patientid;
}

@ -0,0 +1,465 @@
package com.docus.bgts.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author jiashi
* @since 2021-04-14
*/
@Data
@EqualsAndHashCode
@ApiModel(value="TBasic对象", description="病案基本信息")
public class TBasic implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "病案主键")
@TableId(value = "patient_id", type = IdType.ASSIGN_ID)
private String patientId;
/**
*
*/
@ApiModelProperty("住院次数")
private Integer admissTimes;
/**
*
*/
@ApiModelProperty("病案号")
private String inpatientNo;
/**
* id
*/
@ApiModelProperty("住院id号")
private String admissId;
/**
*
*/
@ApiModelProperty("患者姓名")
private String name;
/**
*
*/
@ApiModelProperty("盘号")
private String ph;
/**
*
*/
@ApiModelProperty("患者姓名首拼")
private String nameSpell;
/**
*
*/
@ApiModelProperty("性别")
private String sex;
/**
* _
*/
@ApiModelProperty("年龄_岁")
private Integer age;
/**
* _
*/
@ApiModelProperty("年龄_月")
private Integer ageMonth;
/**
* _
*/
@ApiModelProperty("年龄_天")
private Integer ageDay;
/**
*
*/
@ApiModelProperty("身份证")
private String idCard;
/**
*
*/
@ApiModelProperty("手机号码")
private String telphone;
/**
*
*/
@ApiModelProperty("住院日期")
private Date admissDate;
/**
*
*/
@ApiModelProperty("住院科室")
private String admissDept;
/**
*
*/
@ApiModelProperty("住院科室名称")
private String admissDeptName;
/**
*
*/
@ApiModelProperty("出院日期")
private Date disDate;
/**
*
*/
@ApiModelProperty("出院科室")
private String disDept;
/**
*
*/
@ApiModelProperty("出院科室名称")
private String disDeptName;
/**
*
*/
@ApiModelProperty("实际住院天数")
private Integer admissDays;
/**
*
*/
@ApiModelProperty("主管医生")
private String attending;
/**
*
*/
@ApiModelProperty("主管医生名称")
private String attendingName;
/**
*
*/
@ApiModelProperty("主要诊断编码")
private String mainDiagCode;
/**
*
*/
@ApiModelProperty("主要诊断名称")
private String mainDiagName;
/**
*
*/
@ApiModelProperty("主要手术编码")
private String mainOperateCode;
/**
*
*/
@ApiModelProperty("主要手术名称")
private String mainOperateName;
/**
*
*/
@ApiModelProperty("是否死亡")
private Integer isDead;
/**
* (01)
*/
@ApiModelProperty("是否作废(01是)")
private Integer isCancel;
/**
*
*/
@ApiModelProperty("签收时间")
private Date signTime;
/**
*
*/
@ApiModelProperty("创建时间")
private Date createTime;
/**
*
*/
@ApiModelProperty("修改时间")
private Date updateTime;
/**
* 10
*/
@ApiModelProperty("是否归档 1已归档0未归档")
private Integer isArchive;
/**
*
*/
@ApiModelProperty("归档时间")
private Date archiveTime;
/**
* 1 pdf2 3 pdf4
*/
@ApiModelProperty("1 归档采集pdf2 异地扫描图片3 现场扫描pdf4 其他来源")
private Integer fileSource;
/**
*
*/
@ApiModelProperty("完整性描述")
private String integrityDesc;
/**
* -
*/
@ApiModelProperty("扫描生产软件-视频脑电图号")
private String bColumn1;
/**
* -ep
*/
@ApiModelProperty("扫描生产软件-ep号")
private String bColumn2;
/**
*
*/
@ApiModelProperty("茂名流水号")
private String bColumn3;
/**
* -
*/
@ApiModelProperty("扫描生产软件-门诊号")
private String bColumn4;
/**
* b_column5
*/
@ApiModelProperty("b_column5")
private String bColumn5;
/**
* b_column6
*/
@ApiModelProperty("b_column6")
private Integer bColumn6;
/**
* b_column7
*/
@ApiModelProperty("b_column7")
private Integer bColumn7;
/**
* b_column8
*/
@ApiModelProperty("b_column8")
private Integer bColumn8;
/**
* b_column9
*/
@ApiModelProperty("b_column9")
private Integer bColumn9;
/**
* b_column10
*/
@ApiModelProperty("b_column10")
private Integer bColumn10;
/**
*
*/
@ApiModelProperty("性别名称")
private String sexName;
/**
* (id)
*/
@ApiModelProperty("记账号(省中医患者主索引id)")
private String jzh;
/**
* ()
*/
@ApiModelProperty("患者主索引号(省中医记账号)")
private String empId;
/**
* visit_type_code
*/
@ApiModelProperty("visit_type_code")
private String visitTypeCode;
/**
* visit_type_name
*/
@ApiModelProperty("visit_type_name")
private String visitTypeName;
/**
* tcm_diag_code
*/
@ApiModelProperty("tcm_diag_code")
private String tcmDiagCode;
/**
* tcm_diag_name
*/
@ApiModelProperty("tcm_diag_name")
private String tcmDiagName;
/**
* ward_palce
*/
@ApiModelProperty("ward_palce")
private String wardPalce;
/**
*
*/
@ApiModelProperty("床号位")
private String bedNum;
/**
* 使
*/
@ApiModelProperty("接收时间,目前澄海人医 使用")
private Date receiveTime;
/**
* 13
*/
@ApiModelProperty("状态 1封存3锁定")
private Integer state;
/**
* 2 1
*/
@ApiModelProperty("是否扫描 2否 1是")
private String scanSource;
/**
* id
*/
@ApiModelProperty("暂缓审核配置id ,隔开")
private String cqcDeferAuditConfigId;
/**
* 0 1
*/
@ApiModelProperty("病案是否批注 0没有批注 1有批注")
private Integer commentStatus;
/**
* (0:1)
*/
@ApiModelProperty("医生提交状态(0:未提交1已提交)")
private Integer doctorState;
/**
*
*/
@ApiModelProperty("护士提交状态")
private Integer nurseState;
/**
* 0 1
*/
@ApiModelProperty("纸质签收 0未签收 1已签收")
private Integer cqcSigninfo;
/**
*
*/
@ApiModelProperty("责任护士")
private String dutyNurse;
/**
* 0 1
*/
@ApiModelProperty("审核状态 0否 1是")
private Integer tagState;
/**
*
*/
@ApiModelProperty("是否手术")
private String isOper;
/**
*
*/
@ApiModelProperty("现住址")
private String homeAddr;
/**
*
*/
@ApiModelProperty("损伤中毒")
private String poisoningName;
/**
*
*/
@ApiModelProperty("病理诊断")
private String pathologyName;
/**
*
*/
@ApiModelProperty("其他诊断")
private String otherDiagName;
/**
*
*/
@ApiModelProperty("联系方式")
private String homeTel;
public TBasic() {}
/**
* yn
* @param isDead
*/
public void setIsDead(String isDead) {
this.isDead = isDead!=null&&isDead.toLowerCase().equals("y")?1:0;
}
public Integer getIsDead() {
return isDead;
}
// public void setIsDead(Integer isDead) {
// this.isDead = isDead;
// }
}

@ -12,6 +12,8 @@ public enum Codes {
DIRECTORY("1000","directory"),
//上传接口地址
UPLOAD("0","uploadConnector"),
//封存上传接口地址
SEALUPLOAD("0","sealUpload"),
REPOAL("0","repoalConnector"),
assortid("assortid","assortidKey"),
collectorid("collectorid","collectoridKey"),

@ -22,12 +22,21 @@ public interface IAfCollectTaskService extends IService<AfCollectTask> {
*/
String getpatientIdByEmpId(String empId);
/**
* idpatient_id
* @param sealId
* @return
*/
String getpatientIdBysealId(String sealId);
String getNameByPatientId(String patientId);
String getOutpatientIdByJzhel(String jzh);
void insert(ReportDownDto reportDownDto);
void insertSeal(ReportDownDto reportDownDto);
void insertOut(ReportDownDto reportDownDto);
void updateInterfaceCollect(String collectSubId, int state);

@ -104,6 +104,8 @@ public class TBasicWebService implements ITBasicWebService {
String sortingTimeKey = String.valueOf(FileUtils.getJsonByName("sortingTime"));
// 获取患者主索引号
String empId = String.valueOf(FileUtils.getJsonByName(Codes.EMP_ID.getMessage()));
//电子病历封存id
String seal = String.valueOf(FileUtils.getJsonByName("sealId"));
//判断是否为撤销
String isJudge = String.valueOf(FileUtils.getJsonByName("isJudge"));
if (StringUtils.isBlank(isJudge) || isJudge.equals("0")) {
@ -119,7 +121,6 @@ public class TBasicWebService implements ITBasicWebService {
logger.info("------新增/修改------");
} else if (judgeIndexElement.getText().equals("1")) {
logger.info("---------撤回--------");
CanlcelDto canlcelDto = new CanlcelDto();
String serialnum = String.valueOf(FileUtils.getJsonByName("serialnum"));
String serialnumElement = getElementText(elementRoot, serialnum.split(","));
@ -144,10 +145,10 @@ public class TBasicWebService implements ITBasicWebService {
String sortingTime;
String assortid;
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
if(collectorid.equals("1")){
if (collectorid.equals("1")) {
assortid = String.valueOf(FileUtils.getJsonByName("assortid"));
}else {
assortid = getAssortid(elementRoot);
} else {
assortid = getAssortid(elementRoot);
}
reportDownDto = new ReportDownDto();
@ -158,9 +159,80 @@ public class TBasicWebService implements ITBasicWebService {
reportDownPatientDto = new ReportDownPatientDto();
//获取jzh
String empIdText = getElementText(elementRoot, empId.split(","));
//获取封存id
String sealId = getElementTextCanBeEmpty(elementRoot, seal.split(","));
if (null != sealId && !"".equals(sealId)) {
reportDownPatientDto.setJzh(empIdText);
reportDownPatientDto.setSealId(sealId);
logger.info("封存患者jzh " + empIdText);
reportDownDto.setPatient(reportDownPatientDto);
List<Element> elementList = xmlUtils.getJsonByName(elementRoot);
for (Element element : elementList) {
filetitle = getElementText(element, filetitleKey.split(","));
downurl = getElementText(element, downurlKey.split(","));
//downurl = handleDownUrl(downurl);
//添加护理提交时间
if (collectorid.equals("1")) {
nurseSubmitTime = getElementText(element, nurseSubmitTime.split(","));
afCollectTaskService.updateNurseSubmitTime(reportDownDto, nurseSubmitTime);
afCollectTaskService.insertNurseState(reportDownDto, nurseSubmitTime);
}
//获取电子病历排序时间
sortingTime = getElementTextCanBeEmpty(element, sortingTimeKey.split(","));
//获取采集流水号
serialnum = getElementText(element, serialnmnKey.split(","));
reportDownScanFileDto = new ReportDownScanFileDto();
reportDownScanFileDto.setDownurl(downurl);
reportDownScanFileDto.setFiletitle(filetitle);
reportDownScanFileDto.setSerialnum(serialnum);
reportDownScanFileDto.setSortdate(sortingTime);
reportDownScanFileDto.setFilesource(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filesource"))));
reportDownScanFileDto.setFilestoragetype(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filestoragetype"))));
//判断是否为base64
if (reportDownScanFileDto.getDownurl().length() > 200) {
reportDownScanFileDto.setFiletype(2);
}
reportDownDtoArr.add(reportDownScanFileDto);
}
if (reportDownDtoArr.size() <= 0) {
throw new RuntimeException("不存在必要的基本信息");
} else {
reportDownDto.setScanfiles(reportDownDtoArr);
}
afCollectTaskService.insertSeal(reportDownDto);
String post = "";
logger.info("--------执行上传功能----------");
Map params = JSON.parseObject(JSON.toJSONString(reportDownDto), Map.class);
if (reportDownDto.getScanfiles().get(0).getFiletype() == 1) {
logger.info("封存id--"+reportDownDto.getPatient().getSealId()+ ": 上传参数:" + params);
}
long l = System.currentTimeMillis();
post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.SEALUPLOAD.getMessage())), headMap, params);
long l1 = System.currentTimeMillis();
logger.info("封存id--"+reportDownDto.getPatient().getSealId()+"请求下载耗时----------" + (l1 - l));
if (StringUtils.isBlank(post)) {
logger.info("封存id--"+reportDownDto.getPatient().getSealId()+"--------上传时出现错误,可能是文件服务没有启动----------");
throw new RuntimeException("封存id--"+reportDownDto.getPatient().getSealId()+"上传时出现错误,可能是文件服务没有启动");
}
Map resMap = JSON.parseObject(post, Map.class);
long l7 = System.currentTimeMillis();
logger.info("接口总耗时--------" + (l7 - l6));
if (String.valueOf(resMap.get("code")).equals("500")) {
//病理没有就诊流水号的根据住院号和检查申请日期时间匹配患者
// String empIdText = getElementTextCanBeEmpty(elementRoot, empId.split(","));
logger.info("封存id--"+reportDownDto.getPatient().getSealId()+ "--------上传失败!" + resMap.get("msg"));
throw new RuntimeException("封存id--"+reportDownDto.getPatient().getSealId()+ "上传失败:" + resMap.get("msg"));
} else {
logger.info("----------执行成功-----------");
return ResultUtils.success().asXML();
}
}else {
//病理没有就诊流水号的根据住院号和检查申请日期时间匹配患者
// String empIdText = getElementTextCanBeEmpty(elementRoot, empId.split(","));
// if (null==empIdText||empIdText.equals("")){
// String examApplyDates = getElementText(elementRoot, examApplyDate.split(","));
// String inPatientNos = getElementText(elementRoot, inPatientNo.split(","));
@ -177,143 +249,137 @@ public class TBasicWebService implements ITBasicWebService {
// }
// doctorSubmitTime = getElementText(elementRoot, doctorSubmitTime.split(","));
/**
*
*/
long l2 = System.currentTimeMillis();
String patientId = afCollectTaskService.getpatientIdByEmpId(empIdText);
long l3 = System.currentTimeMillis();
logger.info("查询patient_id耗时"+(l3-l2));
//删除af_downfile表数据
// long l4 = System.currentTimeMillis();
// int i = afCollectTaskService.deleteByPatientIdAndCollectorId(patientId, collectorid);
// long l5 = System.currentTimeMillis();
// logger.info("删除"+empIdText+"af_downfile表"+i+"条数据耗时-----"+(l5-l4));
// //删除t_scan_assort表数据
// long l8 = System.currentTimeMillis();
// int i1 = afCollectTaskService.deleteByPatientIdAndAssortId(patientId, assortid);
// long l11 = System.currentTimeMillis();
// logger.info("删除"+empIdText+"t_scan_assort表"+i1+"条数据耗时-----"+(l11-l8));
// //删除af_collect_task表数据
// long l9 = System.currentTimeMillis();
// int i2 = afCollectTaskService.deleteByPatientIdAndSysFlag(patientId, collectorid);
// long l10 = System.currentTimeMillis();
// logger.info("删除"+empIdText+"af_collect_task表"+i2+"条数据耗时-----"+(l10-l9));
//
reportDownPatientDto.setJzh(empIdText);
logger.info("患者主索引号:" + empIdText);
reportDownDto.setPatient(reportDownPatientDto);
List<Element> elementList = xmlUtils.getJsonByName(elementRoot);
for (Element element : elementList) {
filetitle = getElementText(element, filetitleKey.split(","));
downurl = getElementText(element, downurlKey.split(","));
//downurl = handleDownUrl(downurl);
//添加护理提交时间
// if (filetitle.equals("体温单")||filetitle.equals("护理记录单(通用)")||filetitle.equals("首次护理记录单(通用)")){
// nurseSubmitTime = getElementText(element, nurseSubmitTime.split(","));
// afCollectTaskService.updateNurseSubmitTime(reportDownDto, nurseSubmitTime);
// afCollectTaskService.insertNurseState(reportDownDto,nurseSubmitTime);
// }
//获取电子病历排序时间
sortingTime = getElementTextCanBeEmpty(element,sortingTimeKey.split(","));
//获取采集流水号
serialnum = getElementText(element, serialnmnKey.split(","));
reportDownScanFileDto = new ReportDownScanFileDto();
reportDownScanFileDto.setDownurl(downurl);
reportDownScanFileDto.setFiletitle(filetitle);
reportDownScanFileDto.setSerialnum(serialnum);
reportDownScanFileDto.setSortdate(sortingTime);
reportDownScanFileDto.setFilesource(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filesource"))));
reportDownScanFileDto.setFilestoragetype(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filestoragetype"))));
//判断是否为base64
if (reportDownScanFileDto.getDownurl().length() > 200) {
reportDownScanFileDto.setFiletype(2);
// doctorSubmitTime = getElementText(elementRoot, doctorSubmitTime.split(","));
/**
*
*/
// long l2 = System.currentTimeMillis();
// String patientId = afCollectTaskService.getpatientIdByEmpId(empIdText);
// long l3 = System.currentTimeMillis();
// logger.info("查询patient_id耗时" + (l3 - l2));
// //删除af_downfile表数据
// long l4 = System.currentTimeMillis();
// int i = afCollectTaskService.deleteByPatientIdAndCollectorId(patientId, collectorid);
// long l5 = System.currentTimeMillis();
// logger.info("删除" + empIdText + "af_downfile表" + i + "条数据耗时-----" + (l5 - l4));
// //删除t_scan_assort表数据
// long l8 = System.currentTimeMillis();
// int i1 = afCollectTaskService.deleteByPatientIdAndAssortId(patientId, assortid);
// long l11 = System.currentTimeMillis();
// logger.info("删除" + empIdText + "t_scan_assort表" + i1 + "条数据耗时-----" + (l11 - l8));
// //删除af_collect_task表数据
// long l9 = System.currentTimeMillis();
// int i2 = afCollectTaskService.deleteByPatientIdAndSysFlag(patientId, collectorid);
// long l10 = System.currentTimeMillis();
// logger.info("删除" + empIdText + "af_collect_task表" + i2 + "条数据耗时-----" + (l10 - l9));
reportDownPatientDto.setJzh(empIdText);
logger.info("患者主索引号:" + empIdText);
reportDownDto.setPatient(reportDownPatientDto);
List<Element> elementList = xmlUtils.getJsonByName(elementRoot);
for (Element element : elementList) {
filetitle = getElementText(element, filetitleKey.split(","));
downurl = getElementText(element, downurlKey.split(","));
//downurl = handleDownUrl(downurl);
//添加护理提交时间
if (collectorid.equals("1")) {
nurseSubmitTime = getElementText(element, nurseSubmitTime.split(","));
afCollectTaskService.updateNurseSubmitTime(reportDownDto, nurseSubmitTime);
afCollectTaskService.insertNurseState(reportDownDto, nurseSubmitTime);
}
//获取电子病历排序时间
// sortingTime = getElementTextCanBeEmpty(element, sortingTimeKey.split(","));
//获取采集流水号
serialnum = getElementText(element, serialnmnKey.split(","));
reportDownScanFileDto = new ReportDownScanFileDto();
reportDownScanFileDto.setDownurl(downurl);
reportDownScanFileDto.setFiletitle(filetitle);
reportDownScanFileDto.setSerialnum(serialnum);
// reportDownScanFileDto.setSortdate(sortingTime);
reportDownScanFileDto.setFilesource(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filesource"))));
reportDownScanFileDto.setFilestoragetype(Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filestoragetype"))));
//判断是否为base64
if (reportDownScanFileDto.getDownurl().length() > 200) {
reportDownScanFileDto.setFiletype(2);
}
reportDownDtoArr.add(reportDownScanFileDto);
}
if (reportDownDtoArr.size() <= 0) {
throw new RuntimeException("不存在必要的基本信息");
} else {
reportDownDto.setScanfiles(reportDownDtoArr);
}
if (collectorid.equals("22")) {
//查询正式住院患者信息
TBasic tBasic = tBasicMapper.selectByjzh(empIdText);
if (null != tBasic) {
//查询预住院患者信息
TBasicExtend tBasicExtend = tBasicExtendMapper.selectByPatientId(tBasic.getPatientId());
if (null != tBasicExtend) {
TBasic tBasicPre = tBasicMapper.selectByjzh(tBasicExtend.getPreJzh());
if (null != tBasicPre) {
int pre = tScanAssortMapper.updateByPatientId(tBasic.getPatientId(), tBasicPre.getPatientId());
if (pre <= 0) {
logger.info("当前预住院没有文件!");
} else {
logger.info("本次预住院合并" + pre + "份报告");
}
} else {
logger.info("未查询到预住院患者信息!");
}
}
}
}
reportDownDtoArr.add(reportDownScanFileDto);
}
if (reportDownDtoArr.size() <= 0) {
throw new RuntimeException("不存在必要的基本信息");
} else {
reportDownDto.setScanfiles(reportDownDtoArr);
}
// if (collectorid.equals("22")){
// //查询正式住院患者信息
// TBasic tBasic = tBasicMapper.selectByjzh(empIdText);
// if (null!=tBasic){
// //查询预住院患者信息
// TBasicExtend tBasicExtend = tBasicExtendMapper.selectByPatientId(tBasic.getPatientId());
// if (null!=tBasicExtend){
// TBasic tBasicPre = tBasicMapper.selectByjzh(tBasicExtend.getPreJzh());
// if (null!=tBasicPre){
// int pre = tScanAssortMapper.updateByPatientId(tBasic.getPatientId(), tBasicPre.getPatientId());
// if (pre <= 0) {
// logger.info("当前预住院没有文件!");
// }else {
// logger.info("本次预住院合并"+pre+"份报告");
// }
// }else {
// logger.info("未查询到预住院患者信息!");
// }
// }
// }
// }
//插入医生提交时间
// afCollectTaskService.updateDoctorSubmitTime(reportDownDto, doctorSubmitTime);
//插入医生提交状态
// afCollectTaskService.insertDoctorState(reportDownDto,doctorSubmitTime);
//插入文件af_collect_task表数据
//插入医生提交时间
// afCollectTaskService.updateDoctorSubmitTime(reportDownDto, doctorSubmitTime);
//插入医生提交状态
// afCollectTaskService.insertDoctorState(reportDownDto, doctorSubmitTime);
//插入文件af_collect_task表数据
// synchronized (lock) {
// System.err.println(reportDownDto);
afCollectTaskService.insert(reportDownDto);
// System.err.println(reportDownDto);
afCollectTaskService.insert(reportDownDto);
// }
String post = "";
logger.info("--------执行上传功能----------");
Map params = JSON.parseObject(JSON.toJSONString(reportDownDto), Map.class);
if (reportDownDto.getScanfiles().get(0).getFiletype() == 1) {
logger.info("上传参数:" + params);
}
long l = System.currentTimeMillis();
post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), headMap, params);
long l1 = System.currentTimeMillis();
logger.info("请求下载耗时----------"+(l1-l));
String post = "";
logger.info("--------执行上传功能----------");
Map params = JSON.parseObject(JSON.toJSONString(reportDownDto), Map.class);
if (reportDownDto.getScanfiles().get(0).getFiletype() == 1) {
logger.info(reportDownDto.getPatient().getJzh() + ": 上传参数:" + params);
}
long l = System.currentTimeMillis();
post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), headMap, params);
long l1 = System.currentTimeMillis();
logger.info("请求下载耗时----------" + (l1 - l));
// String post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), map, headMap);
if (StringUtils.isBlank(post)) {
logger.info("--------上传时出现错误,可能是文件服务没有启动----------");
throw new RuntimeException("上传时出现错误,可能是文件服务没有启动");
}
Map resMap = JSON.parseObject(post, Map.class);
long l7 = System.currentTimeMillis();
logger.info("接口总耗时--------"+(l7-l6));
if (String.valueOf(resMap.get("code")).equals("500")) {
throw new RuntimeException(String.valueOf(resMap.get("msg")));
} else {
logger.info("----------执行成功-----------");
return ResultUtils.success().asXML();
if (StringUtils.isBlank(post)) {
logger.info("--------上传时出现错误,可能是文件服务没有启动----------");
throw new RuntimeException("上传时出现错误,可能是文件服务没有启动");
}
Map resMap = JSON.parseObject(post, Map.class);
long l7 = System.currentTimeMillis();
logger.info("接口总耗时--------" + (l7 - l6));
if (String.valueOf(resMap.get("code")).equals("500")) {
logger.info(reportDownDto.getPatient().getJzh() + "--------上传失败!" + resMap.get("msg"));
throw new RuntimeException(reportDownDto.getPatient().getJzh() + "上传失败:" + resMap.get("msg"));
} else {
logger.info("----------执行成功-----------");
return ResultUtils.success().asXML();
}
}
} catch (RuntimeException e) {
e.printStackTrace();
// mrReportErrorService.insert(xml);
// mrReportErrorService.insert(xml);
logger.error(e.getMessage());
// String stackTrace = ExceptionUtils.getStackTrace(e);
// logger.info("错误信息----------"+stackTrace);
String stackTrace = ExceptionUtils.getStackTrace(e);
logger.info("错误信息----------" + stackTrace);
return ResultUtils.fail(e.getMessage());
} catch (Exception e) {
// mrReportErrorService.insert(xml);
// mrReportErrorService.insert(xml);
logger.error(e.getMessage());
// String stackTrace = ExceptionUtils.getStackTrace(e);
// logger.info("错误信息----------"+stackTrace);
String stackTrace = ExceptionUtils.getStackTrace(e);
logger.info("错误信息----------" + stackTrace);
e.printStackTrace();
return ResultUtils.fail(e.getMessage());
}
@ -322,6 +388,7 @@ public class TBasicWebService implements ITBasicWebService {
/**
*
*
* @param xml
* @return
*/
@ -356,7 +423,7 @@ public class TBasicWebService implements ITBasicWebService {
String serialnum;
String filetitle;
String downurl;
// String sortingTime;
// String sortingTime;
int filetype = Integer.parseInt(String.valueOf(FileUtils.getJsonByName("filetype")));
String collectorid = String.valueOf(FileUtils.getJsonByName("collectorid"));
@ -379,7 +446,7 @@ public class TBasicWebService implements ITBasicWebService {
downurl = getElementText(element, downurlKey.split(","));
serialnum = getElementText(element, serialnmnKey.split(","));
reportDownScanFileDto = new ReportDownScanFileDto();
reportDownScanFileDto.setDownurl(downurl.substring(1,downurl.length() - 1));
reportDownScanFileDto.setDownurl(downurl.substring(1, downurl.length() - 1));
reportDownScanFileDto.setFiletitle(filetitle);
reportDownScanFileDto.setSerialnum(serialnum);
reportDownScanFileDto.setFiletype(filetype);
@ -397,7 +464,7 @@ public class TBasicWebService implements ITBasicWebService {
reportDownDto.setScanfiles(reportDownDtoArr);
}
// System.err.println(reportDownDto);
// System.err.println(reportDownDto);
afCollectTaskService.insertOut(reportDownDto);
@ -409,7 +476,7 @@ public class TBasicWebService implements ITBasicWebService {
long l = System.currentTimeMillis();
post = HttpUtils.post(String.valueOf(FileUtils.getJsonByName(Codes.UPLOAD.getMessage())), headMap, params);
long l1 = System.currentTimeMillis();
logger.info("请求下载耗时----------"+(l1-l));
logger.info("请求下载耗时----------" + (l1 - l));
if (StringUtils.isBlank(post)) {
logger.info("--------上传时出现错误,可能是文件服务没有启动----------");
@ -417,7 +484,7 @@ public class TBasicWebService implements ITBasicWebService {
}
Map resMap = JSON.parseObject(post, Map.class);
long l7 = System.currentTimeMillis();
logger.info("接口总耗时--------"+(l7-l6));
logger.info("接口总耗时--------" + (l7 - l6));
if (String.valueOf(resMap.get("code")).equals("500")) {
throw new RuntimeException(String.valueOf(resMap.get("msg")));
} else {
@ -459,7 +526,7 @@ public class TBasicWebService implements ITBasicWebService {
return url;
}
} catch (Exception e) {
e.printStackTrace();
e.printStackTrace();
}
return "";
}
@ -684,10 +751,9 @@ public class TBasicWebService implements ITBasicWebService {
}
}
// public static void main(String[] args) {
// depdf();
// }
public static void main(String[] args) {
depdf();
}
}

@ -29,6 +29,13 @@ public interface AfCollectTaskMapper extends BaseMapper<AfCollectTask> {
*/
String getpatientIdByEmpId(@Param("jzh") String empId);
/**
* idpatient_id
* @param sealId
* @return
*/
String getPatientIdBysealId(@Param("sealId") String sealId);
String selectJzh(@Param("inPatientNo") String inPatientNo,@Param("examApplyDate") String examApplyDate);

@ -16,4 +16,6 @@ public interface TBasicMapper extends BaseMapper<TBasic> {
TBasic selectByjzh(String jzh);
TBasic selectByPatientId(String patientId);
int update(TBasic tbasic);
}

@ -7,10 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.docus.bgts.entity.*;
import com.docus.bgts.enums.Codes;
import com.docus.bgts.facade.IAfCollectTaskService;
import com.docus.bgts.mapper.AfCollectTaskMapper;
import com.docus.bgts.mapper.AfInterfaceCollectMapper;
import com.docus.bgts.mapper.AfInterfaceCollectSubMapper;
import com.docus.bgts.mapper.TBasicExtendMapper;
import com.docus.bgts.mapper.*;
import com.docus.bgts.utils.FileUtils;
import com.docus.bgts.utils.HttpUtils;
import com.docus.bgts.utils.ResultUtils;
@ -52,12 +49,20 @@ public class AfCollectTaskServiceImpl extends ServiceImpl<AfCollectTaskMapper, A
@Autowired
TBasicExtendMapper tBasicExtendMapper;
@Autowired
TBasicMapper tBasicMapper;
@Override
public String getpatientIdByEmpId(String empId) {
String patientId = afCollectTaskMapper.getpatientIdByEmpId(empId);
return patientId;
}
@Override
public String getpatientIdBysealId(String sealId) {
return afCollectTaskMapper.getPatientIdBysealId(sealId);
}
@Override
public String getNameByPatientId(String patientId) {
return afCollectTaskMapper.selectNameByPatientId(patientId);
@ -186,6 +191,64 @@ public class AfCollectTaskServiceImpl extends ServiceImpl<AfCollectTaskMapper, A
reportDownDto.setScanfiles(scanfiles);
}
@Override
public void insertSeal(ReportDownDto reportDownDto) {
if (reportDownDto.getScanfiles().get(0).getFiletype() == 1) {
log.info("新增封存任务表初始数据:" + reportDownDto);
}
AfCollectTask afCollectTask;
String patientId = getpatientIdBysealId(reportDownDto.getPatient().getSealId());
if (StringUtils.isBlank(patientId)) {
throw new RuntimeException("操作的病案信息不存在");
}
reportDownDto.getPatient().setPatientid(patientId);
Date date = new Date();
Integer save = null;
List<ReportDownScanFileDto> scanfiles = reportDownDto.getScanfiles();
for (ReportDownScanFileDto scanfile : scanfiles) {
long l = System.currentTimeMillis();
// 判断任务是否已存在
afCollectTask = afCollectTaskMapper.selectOne(new QueryWrapper<AfCollectTask>().eq("C1", scanfile.getSerialnum()).eq("sysflag", reportDownDto.getCollectorid()));
if (afCollectTask == null || afCollectTask.getId() == null) {
//不存在 新增
afCollectTask = new AfCollectTask();
afCollectTask.setPatientId(patientId);
afCollectTask.setSysflag(reportDownDto.getCollectorid());
afCollectTask.setState("0");
afCollectTask.setSyncTime(date);
afCollectTask.setC1(scanfile.getSerialnum());
afCollectTask.setC2(scanfile.getFiletitle());
afCollectTask.setC3(reportDownDto.getPatient().getJzh());
save = afCollectTaskMapper.insert(afCollectTask);
} else {
//存在就修改
afCollectTask.setPatientId(patientId);
afCollectTask.setSysflag(reportDownDto.getCollectorid());
afCollectTask.setState("0");
afCollectTask.setSyncTime(date);
afCollectTask.setC1(scanfile.getSerialnum());
afCollectTask.setC2(scanfile.getFiletitle());
afCollectTask.setC3(reportDownDto.getPatient().getJzh());
save = afCollectTaskMapper.updateById(afCollectTask);
}
if (save <= 0) {
log.info("封存任务表操作出错");
throw new RuntimeException("封存插入病案任务表数据出错");
}
if (afCollectTask.getId() != null) {
scanfile.setTaskid(afCollectTask.getId());
} else {
log.info("封存插入任务id为空");
throw new RuntimeException("封存插入任务id为空");
}
}
reportDownDto.setScanfiles(scanfiles);
}
@Override
public void updateInterfaceCollect(String collectSubId, int state) {
AfInterfaceCollectSub afInterfaceCollectSub = afInterfaceCollectSubMapper.selectById(collectSubId);
@ -367,57 +430,58 @@ public class AfCollectTaskServiceImpl extends ServiceImpl<AfCollectTaskMapper, A
@Override
public void insertNurseState(ReportDownDto reportDownDto, String nurseSubmitTime) {
String patientId = getpatientIdByEmpId(reportDownDto.getPatient().getJzh());
if (StringUtils.isBlank(patientId)) {
TBasic tBasic = tBasicMapper.selectByjzh(reportDownDto.getPatient().getJzh());
if (null == tBasic) {
throw new RuntimeException("操作的病案信息不存在");
}
CqcSubmitState cqcSubmitState1 = afCollectTaskMapper.selectByPatientId(patientId);
if (null == cqcSubmitState1) {
CqcSubmitState cqcSubmitState = new CqcSubmitState();
cqcSubmitState.setPatientId(patientId);
if (null != nurseSubmitTime && !("").equals(nurseSubmitTime)) {
cqcSubmitState.setNurseState(1);
} else {
cqcSubmitState.setNurseState(0);
}
int i = afCollectTaskMapper.insertDoctorState(cqcSubmitState);
if (null != nurseSubmitTime && !("").equals(nurseSubmitTime)) {
tBasic.setNurseState(1);
int update = tBasicMapper.update(tBasic);
if (update > 0) {
log.info("护士提交状态修改成功!");
}else {
log.info("护士提交状态修改失败!");
}
} else {
if (null != nurseSubmitTime && !("").equals(nurseSubmitTime)) {
cqcSubmitState1.setNurseState(1);
} else {
cqcSubmitState1.setNurseState(0);
tBasic.setNurseState(0);
int update = tBasicMapper.update(tBasic);
if (update > 0) {
log.info("护士提交状态修改成功!");
}else {
log.info("护士提交状态修改失败!");
}
afCollectTaskMapper.updateDoctorState(cqcSubmitState1);
}
}
@Override
public void insertDoctorState(ReportDownDto reportDownDto, String doctorSubmitTime) {
String patientId = getpatientIdByEmpId(reportDownDto.getPatient().getJzh());
if (StringUtils.isBlank(patientId)) {
TBasic tBasic = tBasicMapper.selectByjzh(reportDownDto.getPatient().getJzh());
if (null == tBasic) {
throw new RuntimeException("操作的病案信息不存在");
}
CqcSubmitState cqcSubmitState1 = afCollectTaskMapper.selectByPatientId(patientId);
if (null == cqcSubmitState1) {
CqcSubmitState cqcSubmitState = new CqcSubmitState();
cqcSubmitState.setPatientId(patientId);
if (null != doctorSubmitTime && !("").equals(doctorSubmitTime)) {
cqcSubmitState.setDoctorState(1);
} else {
cqcSubmitState.setDoctorState(0);
}
afCollectTaskMapper.insertDoctorState(cqcSubmitState);
} else {
if (null != doctorSubmitTime && !("").equals(doctorSubmitTime)) {
cqcSubmitState1.setDoctorState(1);
tBasic.setDoctorState(1);
int update = tBasicMapper.update(tBasic);
if (update > 0) {
log.info("医生提交状态修改成功!");
}else {
log.info("医生提交状态修改失败!");
}
} else {
cqcSubmitState1.setDoctorState(0);
tBasic.setDoctorState(0);
int update = tBasicMapper.update(tBasic);
if (update > 0) {
log.info("医生提交状态修改成功!");
}else {
log.info("医生提交状态修改失败!");
}
}
afCollectTaskMapper.updateDoctorState(cqcSubmitState1);
}
}

@ -108,5 +108,8 @@ where patient_id=#{patientId}
select creater_name from docus_medicalrecord.cqc_back_info_log where patient_id=#{patientId} and create_time in
(select max(create_time) from docus_medicalrecord.cqc_back_info_log where patient_id=#{patientId})
</select>
<select id="getPatientIdBysealId" resultType="java.lang.String">
select patient_id from docus_medicalrecord.t_seal where seal_id=#{sealId}
</select>
</mapper>

@ -3,61 +3,74 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.docus.bgts.mapper.TBasicMapper">
<update id="updateDisDate">
update docus_medicalrecord.t_basic
<set>
<if test="tBasic.admiss_times != null">
IPAddress=#{pcmachine.ipaddress},
</if>
<if test="pcmachine.lastonline != null">
LastOnline=#{pcmachine.lastonline},
</if>
<if test="pcmachine.pcstatus != null">
PCStatus=#{pcmachine.pcstatus}
</if>
<if test="pcmachine.ipaddress != null">
IPAddress=#{pcmachine.ipaddress},
</if>
<if test="pcmachine.lastonline != null">
LastOnline=#{pcmachine.lastonline},
</if>
<if test="pcmachine.pcstatus != null">
PCStatus=#{pcmachine.pcstatus}
</if>
<if test="pcmachine.ipaddress != null">
IPAddress=#{pcmachine.ipaddress},
</if>
<if test="pcmachine.lastonline != null">
LastOnline=#{pcmachine.lastonline},
</if>
<if test="pcmachine.pcstatus != null">
PCStatus=#{pcmachine.pcstatus}
</if>
<if test="pcmachine.ipaddress != null">
IPAddress=#{pcmachine.ipaddress},
</if>
<if test="pcmachine.lastonline != null">
LastOnline=#{pcmachine.lastonline},
</if>
<if test="pcmachine.pcstatus != null">
PCStatus=#{pcmachine.pcstatus}
</if>
<if test="pcmachine.ipaddress != null">
IPAddress=#{pcmachine.ipaddress},
</if>
<if test="pcmachine.lastonline != null">
LastOnline=#{pcmachine.lastonline},
</if>
<if test="pcmachine.pcstatus != null">
PCStatus=#{pcmachine.pcstatus}
</if>
</set>
where id=#{pcmachine.id}
</update>
<update id="updateDisDate">
update docus_medicalrecord.t_basic
<set>
<if test="tBasic.admiss_times != null">
IPAddress=#{pcmachine.ipaddress},
</if>
<if test="pcmachine.lastonline != null">
LastOnline=#{pcmachine.lastonline},
</if>
<if test="pcmachine.pcstatus != null">
PCStatus=#{pcmachine.pcstatus}
</if>
<if test="pcmachine.ipaddress != null">
IPAddress=#{pcmachine.ipaddress},
</if>
<if test="pcmachine.lastonline != null">
LastOnline=#{pcmachine.lastonline},
</if>
<if test="pcmachine.pcstatus != null">
PCStatus=#{pcmachine.pcstatus}
</if>
<if test="pcmachine.ipaddress != null">
IPAddress=#{pcmachine.ipaddress},
</if>
<if test="pcmachine.lastonline != null">
LastOnline=#{pcmachine.lastonline},
</if>
<if test="pcmachine.pcstatus != null">
PCStatus=#{pcmachine.pcstatus}
</if>
<if test="pcmachine.ipaddress != null">
IPAddress=#{pcmachine.ipaddress},
</if>
<if test="pcmachine.lastonline != null">
LastOnline=#{pcmachine.lastonline},
</if>
<if test="pcmachine.pcstatus != null">
PCStatus=#{pcmachine.pcstatus}
</if>
<if test="pcmachine.ipaddress != null">
IPAddress=#{pcmachine.ipaddress},
</if>
<if test="pcmachine.lastonline != null">
LastOnline=#{pcmachine.lastonline},
</if>
<if test="pcmachine.pcstatus != null">
PCStatus=#{pcmachine.pcstatus}
</if>
</set>
where id=#{pcmachine.id}
</update>
<update id="update" parameterType="com.docus.bgts.entity.TBasic">
UPDATE docus_medicalrecord.t_basic
<set>
<if test="null != doctorState and '' != doctorState">doctor_state = #{doctorState},</if>
<if test="null != nurseState and '' != nurseState">nurse_state = #{nurseState},</if>
</set>
WHERE patient_id = #{patientId}
</update>
<select id="selectByjzh" resultType="com.docus.bgts.entity.TBasic">
SELECT * FROM docus_medicalrecord.t_basic WHERE jzh=#{jzh}
SELECT *
FROM docus_medicalrecord.t_basic
WHERE jzh = #{jzh}
</select>
<select id="selectByPatientId" resultType="com.docus.bgts.entity.TBasic">
SELECT * FROM docus_medicalrecord.t_basic WHERE patient_id=#{patientId}
SELECT *
FROM docus_medicalrecord.t_basic
WHERE patient_id = #{patientId}
</select>
</mapper>
Loading…
Cancel
Save