|
@@ -3,7 +3,6 @@ package com.diagbot.util;
|
|
import com.diagbot.vo.his.FeedbackHosVO;
|
|
import com.diagbot.vo.his.FeedbackHosVO;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
|
import java.sql.*;
|
|
import java.sql.*;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.ResourceBundle;
|
|
import java.util.ResourceBundle;
|
|
@@ -135,44 +134,34 @@ public class PushFeedbackConn {
|
|
PreparedStatement state=connection.prepareStatement("insert into MEDICAL_QC_MSG " +
|
|
PreparedStatement state=connection.prepareStatement("insert into MEDICAL_QC_MSG " +
|
|
"(PATIENT_ID,VISIT_ID,MESSAGE,ISSUED_BY,ISSUED_DATE_TIME,TOPIC_ID,DEPT_STAYED,MSG_STATUS,EXPLAININFO,POINT,DETAILCODE" +
|
|
"(PATIENT_ID,VISIT_ID,MESSAGE,ISSUED_BY,ISSUED_DATE_TIME,TOPIC_ID,DEPT_STAYED,MSG_STATUS,EXPLAININFO,POINT,DETAILCODE" +
|
|
",CCIDS,POINT_TYPE,SENDER_DOCTOR,DOCTOR_IN_CHARGE_ID,APPLY_ENV,QA_EVENT_TYPE,QC_MSG_CODE,DOCTOR_IN_CHARGE,TOPIC)"+
|
|
",CCIDS,POINT_TYPE,SENDER_DOCTOR,DOCTOR_IN_CHARGE_ID,APPLY_ENV,QA_EVENT_TYPE,QC_MSG_CODE,DOCTOR_IN_CHARGE,TOPIC)"+
|
|
- "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
|
|
|
|
|
|
+ "values(?,?,?,?,to_date(?,'yyyy-mm-dd hh24:mi:ss'),?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
|
|
state.setString(1, patientId);
|
|
state.setString(1, patientId);
|
|
state.setString(2, visitId);
|
|
state.setString(2, visitId);
|
|
state.setString(3,feedbackHosVO.getQcresultDetailMsg());
|
|
state.setString(3,feedbackHosVO.getQcresultDetailMsg());
|
|
state.setString(4,"评价质控");
|
|
state.setString(4,"评价质控");
|
|
- state.setDate(5, Date.valueOf(DateUtil.getCurrentDateStr("yyyy-MM-dd")));
|
|
|
|
- state.setString(6,Long.toString(feedbackHosVO.getModeId()));
|
|
|
|
|
|
+ state.setString(5, DateUtil.formatDateTime(DateUtil.now()));
|
|
|
|
+ state.setString(6,Long.toString(feedbackHosVO.getId()));
|
|
state.setString(7,feedbackHosVO.getDeptId());
|
|
state.setString(7,feedbackHosVO.getDeptId());
|
|
state.setInt(8,0);
|
|
state.setInt(8,0);
|
|
state.setString(9,feedbackHosVO.getExplainInfo());//缺陷说明
|
|
state.setString(9,feedbackHosVO.getExplainInfo());//缺陷说明
|
|
- state.setInt(10, feedbackHosVO.getQcresultDetaiScore().intValue());
|
|
|
|
- if(feedbackHosVO.getCasesEntryId()!=null){
|
|
|
|
- state.setString(11,Long.toString(feedbackHosVO.getCasesEntryId()));//缺陷编号
|
|
|
|
|
|
+ state.setInt(10, feedbackHosVO.getQcresultDetaiScore()!=null?feedbackHosVO.getQcresultDetaiScore().intValue():0);
|
|
|
|
+ if(feedbackHosVO.getOperationType().equals("4")){
|
|
|
|
+ state.setString(11,Long.toString(feedbackHosVO.getId()));//缺陷编号
|
|
|
|
+ }else{
|
|
|
|
+ if(feedbackHosVO.getCasesEntryId()!=null){
|
|
|
|
+ state.setString(11,Long.toString(feedbackHosVO.getCasesEntryId()));//缺陷编号
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
state.setString(12,feedbackHosVO.getCcCodes());//抄送人工号集合
|
|
state.setString(12,feedbackHosVO.getCcCodes());//抄送人工号集合
|
|
state.setInt(13,1);//扣分类型,0,自动扣分,1:手动扣分
|
|
state.setInt(13,1);//扣分类型,0,自动扣分,1:手动扣分
|
|
state.setString(14,feedbackHosVO.getSenderCode());//提交人工号
|
|
state.setString(14,feedbackHosVO.getSenderCode());//提交人工号
|
|
state.setString(15,feedbackHosVO.getReceiverCode());//接收人工号
|
|
state.setString(15,feedbackHosVO.getReceiverCode());//接收人工号
|
|
state.setString(16,"MEDDOC");
|
|
state.setString(16,"MEDDOC");
|
|
- String operationType="";
|
|
|
|
-
|
|
|
|
- if(feedbackHosVO.getOperationType().equals("1")){
|
|
|
|
- operationType="修改";
|
|
|
|
- }else if(feedbackHosVO.getOperationType().equals("2")){
|
|
|
|
- operationType="删除";
|
|
|
|
- }else if(feedbackHosVO.getOperationType().equals("3")){
|
|
|
|
- operationType="新增已有";
|
|
|
|
- }else if(feedbackHosVO.getOperationType().equals("4")){
|
|
|
|
- operationType="新增缺失";
|
|
|
|
- }else if(feedbackHosVO.getOperationType().equals("5")){
|
|
|
|
- operationType="恢复";
|
|
|
|
- }else {
|
|
|
|
- operationType="其他";
|
|
|
|
- }
|
|
|
|
- state.setString(17,operationType);
|
|
|
|
|
|
+ state.setString(17,feedbackHosVO.getModeName().trim().replaceAll(" ","").replaceAll("<ul></ul>",""));
|
|
state.setString(18,Long.toString(feedbackHosVO.getModeId()));
|
|
state.setString(18,Long.toString(feedbackHosVO.getModeId()));
|
|
state.setString(19,feedbackHosVO.getReceiverName());//接收人姓名
|
|
state.setString(19,feedbackHosVO.getReceiverName());//接收人姓名
|
|
- state.setString(20,feedbackHosVO.getModeName().trim());
|
|
|
|
|
|
+ state.setString(20,feedbackHosVO.getModeName().trim().replaceAll(" ","").replaceAll("<ul></ul>",""));
|
|
re = state.executeUpdate();
|
|
re = state.executeUpdate();
|
|
if(re < 0){ //插入失败
|
|
if(re < 0){ //插入失败
|
|
connection.rollback(); //回滚
|
|
connection.rollback(); //回滚
|
|
@@ -194,8 +183,10 @@ public class PushFeedbackConn {
|
|
}
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
- BigDecimal number = new BigDecimal(12.22);
|
|
|
|
- System.out.println(Date.valueOf(DateUtil.getCurrentDateStr("yyyy-MM-dd")));
|
|
|
|
|
|
+// BigDecimal number = new BigDecimal(12.22);
|
|
|
|
+ System.out.println(Timestamp.valueOf(DateUtil.getCurrentDateStr("")));
|
|
|
|
+ /* String msg = "病案首页 <ul> </ul> ";
|
|
|
|
+ System.out.println(msg.trim().replaceAll(" ","").replaceAll("<ul></ul>",""));*/
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -210,7 +201,8 @@ public class PushFeedbackConn {
|
|
connection = getConnection();
|
|
connection = getConnection();
|
|
connection.setAutoCommit(false);//事物开始
|
|
connection.setAutoCommit(false);//事物开始
|
|
String sql ="delete from MEDICAL_QC_MSG ";
|
|
String sql ="delete from MEDICAL_QC_MSG ";
|
|
- sql+=" where PATIENT_ID = '"+patientId+"' and VISIT_ID = '"+visitId+"' and DETAILCODE='"+feedbackHosVO.getId()+"'";
|
|
|
|
|
|
+ sql+=" where PATIENT_ID = '"+patientId+"' and VISIT_ID = '"+visitId+"'" +
|
|
|
|
+ " and DETAILCODE='"+Long.toString(feedbackHosVO.getCasesEntryId())+"'";
|
|
PreparedStatement state=connection.prepareStatement(sql);
|
|
PreparedStatement state=connection.prepareStatement(sql);
|
|
re = state.executeUpdate();
|
|
re = state.executeUpdate();
|
|
if(re < 0){ //删除失败
|
|
if(re < 0){ //删除失败
|
|
@@ -244,15 +236,15 @@ public class PushFeedbackConn {
|
|
connection = getConnection();
|
|
connection = getConnection();
|
|
connection.setAutoCommit(false);//事物开始
|
|
connection.setAutoCommit(false);//事物开始
|
|
String sql =" update MEDICAL_QC_MSG set " +
|
|
String sql =" update MEDICAL_QC_MSG set " +
|
|
- " MESSAGE=?,ISSUED_BY=?,ISSUED_DATE_TIME=?,TOPIC_ID=?,DEPT_STAYED=?,MSG_STATUS=?,EXPLAININFO=?," +
|
|
|
|
|
|
+ " MESSAGE=?,ISSUED_BY=?,ISSUED_DATE_TIME=to_date(?,'yyyy-mm-dd hh24:mi:ss'),TOPIC_ID=?,DEPT_STAYED=?,MSG_STATUS=?,EXPLAININFO=?," +
|
|
" POINT=?,CCIDS=?,POINT_TYPE=?,SENDER_DOCTOR=?,DOCTOR_IN_CHARGE_ID=?," +
|
|
" POINT=?,CCIDS=?,POINT_TYPE=?,SENDER_DOCTOR=?,DOCTOR_IN_CHARGE_ID=?," +
|
|
" APPLY_ENV=?,QA_EVENT_TYPE=?,QC_MSG_CODE=?,DOCTOR_IN_CHARGE=?,TOPIC=?";
|
|
" APPLY_ENV=?,QA_EVENT_TYPE=?,QC_MSG_CODE=?,DOCTOR_IN_CHARGE=?,TOPIC=?";
|
|
sql+=" where PATIENT_ID = ? and VISIT_ID = ? and DETAILCODE=?";
|
|
sql+=" where PATIENT_ID = ? and VISIT_ID = ? and DETAILCODE=?";
|
|
PreparedStatement state=connection.prepareStatement(sql);
|
|
PreparedStatement state=connection.prepareStatement(sql);
|
|
state.setString(1,feedbackHosVO.getQcresultDetailMsg());
|
|
state.setString(1,feedbackHosVO.getQcresultDetailMsg());
|
|
state.setString(2,"评价质控");
|
|
state.setString(2,"评价质控");
|
|
- state.setDate(3, Date.valueOf(DateUtil.getCurrentDateStr("yyyy-MM-dd")));
|
|
|
|
- state.setString(4,Long.toString(feedbackHosVO.getModeId()));
|
|
|
|
|
|
+ state.setString(3, DateUtil.formatDateTime(DateUtil.now()));
|
|
|
|
+ state.setString(4,Long.toString(feedbackHosVO.getId()));
|
|
state.setString(5,feedbackHosVO.getDeptId());
|
|
state.setString(5,feedbackHosVO.getDeptId());
|
|
state.setInt(6,0);
|
|
state.setInt(6,0);
|
|
state.setString(7,feedbackHosVO.getExplainInfo());//缺陷说明
|
|
state.setString(7,feedbackHosVO.getExplainInfo());//缺陷说明
|
|
@@ -262,27 +254,19 @@ public class PushFeedbackConn {
|
|
state.setString(11,feedbackHosVO.getSenderCode());//提交人工号
|
|
state.setString(11,feedbackHosVO.getSenderCode());//提交人工号
|
|
state.setString(12,feedbackHosVO.getReceiverCode());//接收人工号
|
|
state.setString(12,feedbackHosVO.getReceiverCode());//接收人工号
|
|
state.setString(13,"MEDDOC");
|
|
state.setString(13,"MEDDOC");
|
|
- String operationType="";
|
|
|
|
- if(feedbackHosVO.getOperationType().equals("1")){
|
|
|
|
- operationType="修改";
|
|
|
|
- }else if(feedbackHosVO.getOperationType().equals("2")){
|
|
|
|
- operationType="删除";
|
|
|
|
- }else if(feedbackHosVO.getOperationType().equals("3")){
|
|
|
|
- operationType="新增已有";
|
|
|
|
- }else if(feedbackHosVO.getOperationType().equals("4")){
|
|
|
|
- operationType="新增缺失";
|
|
|
|
- }else if(feedbackHosVO.getOperationType().equals("5")){
|
|
|
|
- operationType="恢复";
|
|
|
|
- }else {
|
|
|
|
- operationType="其他";
|
|
|
|
- }
|
|
|
|
- state.setString(14,operationType);
|
|
|
|
|
|
+ state.setString(14,feedbackHosVO.getModeName().trim().replaceAll(" ","").replaceAll("<ul></ul>",""));
|
|
state.setString(15,Long.toString(feedbackHosVO.getModeId()));
|
|
state.setString(15,Long.toString(feedbackHosVO.getModeId()));
|
|
state.setString(16,feedbackHosVO.getReceiverName());//接收人姓名
|
|
state.setString(16,feedbackHosVO.getReceiverName());//接收人姓名
|
|
- state.setString(17,feedbackHosVO.getModeName().trim());
|
|
|
|
|
|
+ state.setString(17,feedbackHosVO.getModeName().trim().replaceAll(" ","").replaceAll("<ul></ul>",""));
|
|
state.setString(18, patientId);
|
|
state.setString(18, patientId);
|
|
state.setString(19, visitId);
|
|
state.setString(19, visitId);
|
|
- state.setString(20,Long.toString(feedbackHosVO.getCasesEntryId()));//缺陷编号
|
|
|
|
|
|
+ if(feedbackHosVO.getOperationType().equals("4")){
|
|
|
|
+ state.setString(20,Long.toString(feedbackHosVO.getId()));//缺陷编号
|
|
|
|
+ }else{
|
|
|
|
+ if(feedbackHosVO.getCasesEntryId()!=null){
|
|
|
|
+ state.setString(20,Long.toString(feedbackHosVO.getCasesEntryId()));//缺陷编号
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
re = state.executeUpdate();
|
|
re = state.executeUpdate();
|
|
if(re < 0){ //修改失败
|
|
if(re < 0){ //修改失败
|
|
@@ -310,12 +294,12 @@ public class PushFeedbackConn {
|
|
try {
|
|
try {
|
|
connection = getConnection();
|
|
connection = getConnection();
|
|
connection.setAutoCommit(false);//事物开始
|
|
connection.setAutoCommit(false);//事物开始
|
|
- String sql =" select DETAILCODE,MSG_STATUS from MEDICAL_QC_MSG ";
|
|
|
|
- sql+=" where DETAILCODE in("+feedbackHosVO.getIds()+")";
|
|
|
|
|
|
+ String sql =" select TOPIC_ID,MSG_STATUS from MEDICAL_QC_MSG ";
|
|
|
|
+ sql+=" where DETAILCODE in("+feedbackHosVO.getIds()+") or TOPIC_ID in("+ feedbackHosVO.getIds() +")";
|
|
rs =this.Query(sql, null);
|
|
rs =this.Query(sql, null);
|
|
while(rs.next()){
|
|
while(rs.next()){
|
|
FeedbackHosVO hosVO=new FeedbackHosVO();
|
|
FeedbackHosVO hosVO=new FeedbackHosVO();
|
|
- hosVO.setId(Long.valueOf(rs.getString("DETAILCODE")));
|
|
|
|
|
|
+ hosVO.setId(Long.valueOf(rs.getString("TOPIC_ID")));
|
|
hosVO.setMsgStatus(rs.getString("MSG_STATUS"));
|
|
hosVO.setMsgStatus(rs.getString("MSG_STATUS"));
|
|
|
|
|
|
statusList.add(hosVO);
|
|
statusList.add(hosVO);
|
|
@@ -336,7 +320,12 @@ public class PushFeedbackConn {
|
|
try {
|
|
try {
|
|
connection = getConnection();
|
|
connection = getConnection();
|
|
connection.setAutoCommit(false);//事物开始
|
|
connection.setAutoCommit(false);//事物开始
|
|
- String sql =" select count(*) from MEDICAL_QC_MSG where PATIENT_ID = '"+patientId+"' and VISIT_ID = '"+visitId+"' and DETAILCODE='"+feedbackHosVO.getCasesEntryId()+"'";
|
|
|
|
|
|
+ String sql =" select count(*) from MEDICAL_QC_MSG where PATIENT_ID = '"+patientId+"' and VISIT_ID = '"+visitId+"'";
|
|
|
|
+ if(feedbackHosVO.getOperationType().equals("4")){
|
|
|
|
+ sql+=" and DETAILCODE='"+Long.toString(feedbackHosVO.getId())+"'";
|
|
|
|
+ }else{
|
|
|
|
+ sql+=" and DETAILCODE='"+Long.toString(feedbackHosVO.getCasesEntryId())+"'";
|
|
|
|
+ }
|
|
rs =this.Query(sql, null);
|
|
rs =this.Query(sql, null);
|
|
if(rs.next()){
|
|
if(rs.next()){
|
|
count=rs.getInt(1);
|
|
count=rs.getInt(1);
|