|
@@ -0,0 +1,432 @@
|
|
|
|
|
+package com.nb.admin.converter;
|
|
|
|
|
+
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
|
|
+import cn.hutool.core.date.DateTime;
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
|
|
+import cn.hutool.core.io.IoUtil;
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
|
|
+import cn.hutool.json.*;
|
|
|
|
|
+import com.nb.admin.AdminApplication;
|
|
|
|
|
+import com.nb.core.utils.ThreadUtil;
|
|
|
|
|
+import com.nb.mq.entity.PcAnalgesicScoreEntity;
|
|
|
|
|
+import com.nb.mq.entity.PcPatientEntity;
|
|
|
|
|
+import com.nb.mq.entity.PcPumpEntity;
|
|
|
|
|
+import com.nb.mq.listener.RabbitMqListener;
|
|
|
|
|
+import com.nb.oss.strategy.FileUtil;
|
|
|
|
|
+import com.nb.web.api.feign.IDeviceClient;
|
|
|
|
|
+import lombok.Data;
|
|
|
|
|
+import org.junit.Test;
|
|
|
|
|
+import org.junit.jupiter.api.extension.ExtendWith;
|
|
|
|
|
+import org.junit.runner.RunWith;
|
|
|
|
|
+import org.mockito.junit.jupiter.MockitoExtension;
|
|
|
|
|
+import org.python.antlr.ast.Str;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.amqp.core.Message;
|
|
|
|
|
+import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
|
+import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
+
|
|
|
|
|
+import java.io.IOException;
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
|
|
+import java.nio.charset.Charset;
|
|
|
|
|
+import java.util.Comparator;
|
|
|
|
|
+import java.util.Date;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+import java.util.concurrent.CompletableFuture;
|
|
|
|
|
+import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * @ClassName : LoraDataConverterTest
|
|
|
|
|
+ * @Description : lora数据转换对接
|
|
|
|
|
+ * @Author : LF
|
|
|
|
|
+ * @Date: 2023年03月09日
|
|
|
|
|
+ */
|
|
|
|
|
+//@ExtendWith(MockitoExtension.class)
|
|
|
|
|
+@RunWith(SpringRunner.class)
|
|
|
|
|
+@SpringBootTest(classes = AdminApplication.class)
|
|
|
|
|
+public class LoraDataConverterTest {
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RabbitMqListener rabbitMqListener;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IDeviceClient deviceClient;
|
|
|
|
|
+
|
|
|
|
|
+ private String receiveRecord="C:\\Users\\JR\\Desktop\\lora数据对接\\ReceiveRecord.json";
|
|
|
|
|
+
|
|
|
|
|
+ private String patientInfoRecord="C:\\Users\\JR\\Desktop\\lora数据对接\\PatientInfo.json";
|
|
|
|
|
+
|
|
|
|
|
+ private String evalRecord="C:\\Users\\JR\\Desktop\\lora数据对接\\AnalgesicScore.json";
|
|
|
|
|
+ @Test
|
|
|
|
|
+ public void insertDeviceData(){
|
|
|
|
|
+ String read = IoUtil.read(FileUtil.getReader(cn.hutool.core.io.FileUtil.file(receiveRecord), Charset.defaultCharset()));
|
|
|
|
|
+ JSONObject parse = JSONUtil.parseObj(read,true);
|
|
|
|
|
+ System.out.println("======================文件读取结束,开始解析======================");
|
|
|
|
|
+ JSONArray arrays = parse.getJSONArray("RECORDS");
|
|
|
|
|
+ AtomicInteger count=new AtomicInteger(0);
|
|
|
|
|
+ Map<String, List<ReceiveRecord>> recordMaps = arrays.parallelStream().map(json -> {
|
|
|
|
|
+ return JSONUtil.toBean(json.toString(), ReceiveRecord.class);
|
|
|
|
|
+ }).filter(record-> StrUtil.isNotEmpty(record.getPumpCode()))
|
|
|
|
|
+ .collect(Collectors.groupingBy(ReceiveRecord::getPumpCode));
|
|
|
|
|
+ recordMaps.values()
|
|
|
|
|
+ .forEach(records->{
|
|
|
|
|
+
|
|
|
|
|
+ System.out.println("======================开始处理设备号 " + CollectionUtil.getLast(records).getPumpCode() + "的数据,共"+records.size()+"条");
|
|
|
|
|
+ boolean newInfusion=false;
|
|
|
|
|
+ for (int i = 0; i < records.size(); i++) {
|
|
|
|
|
+ if(i!=records.size()-1){
|
|
|
|
|
+ ReceiveRecord nextRecord = records.get(i + 1);
|
|
|
|
|
+ ReceiveRecord currentRecord = records.get(i);
|
|
|
|
|
+ if(!ObjectUtil.equals(nextRecord.getStartTime(),currentRecord.getStartTime())||
|
|
|
|
|
+ StrUtil.equals(currentRecord.getViewState(),"关机")||
|
|
|
|
|
+ StrUtil.equals(nextRecord.getViewState(),"开机")){
|
|
|
|
|
+ currentRecord.setRemove(false);
|
|
|
|
|
+ newInfusion=StrUtil.equals(nextRecord.getViewState(),"开机");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ List<PcPumpEntity> pumpRecords = records.stream().map(ReceiveRecord::toPcPump).sorted(Comparator.comparing(PcPumpEntity::getLastUploadTime)).collect(Collectors.toList());
|
|
|
|
|
+ for (PcPumpEntity pumpRecord : pumpRecords) {
|
|
|
|
|
+ String json = JSONUtil.toJsonPrettyStr(pumpRecord);
|
|
|
|
|
+ Message message = new Message(json.getBytes());
|
|
|
|
|
+ if(pumpRecord.getPatientCode().equals("1111234")){
|
|
|
|
|
+ System.out.println(json);
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ rabbitMqListener.pumpQueue(message,null);
|
|
|
|
|
+ if(newInfusion){
|
|
|
|
|
+ deviceClient.refreshClassification(pumpRecord.getPumpCode());
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ count.incrementAndGet();
|
|
|
|
|
+ System.out.println("=====================已处理" + count.get() + "条数据");
|
|
|
|
|
+ }
|
|
|
|
|
+ System.out.println("======================处理完毕设备号 " + arrays.size() + "的数据,共"+records.size()+"条");
|
|
|
|
|
+ });
|
|
|
|
|
+ insertPatient();
|
|
|
|
|
+ insertEval();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Test
|
|
|
|
|
+ public void insertPatient(){
|
|
|
|
|
+ String read = IoUtil.read(FileUtil.getReader(cn.hutool.core.io.FileUtil.file(patientInfoRecord), Charset.defaultCharset()));
|
|
|
|
|
+ JSONObject parse = JSONUtil.parseObj(read,true);
|
|
|
|
|
+ System.out.println("======================文件读取结束,开始解析======================");
|
|
|
|
|
+ JSONArray arrays = parse.getJSONArray("RECORDS");
|
|
|
|
|
+ AtomicInteger count=new AtomicInteger(0);
|
|
|
|
|
+ Map<String, List<PatientInfo>> recordMaps = arrays.parallelStream().map(json -> {
|
|
|
|
|
+ return JSONUtil.toBean(json.toString(), PatientInfo.class);
|
|
|
|
|
+ }).filter(record-> StrUtil.isNotEmpty(record.getPumpCode()))
|
|
|
|
|
+ .collect(Collectors.groupingBy(PatientInfo::getPumpCode));
|
|
|
|
|
+ recordMaps.values()
|
|
|
|
|
+ .forEach(records->{
|
|
|
|
|
+ System.out.println("======================开始处理住院号 " + CollectionUtil.getLast(records).getPumpCode() + "的数据,共"+records.size()+"条");
|
|
|
|
|
+ List<PcPatientEntity> pumpRecords = records.stream().map(PatientInfo::toPatient).collect(Collectors.toList());
|
|
|
|
|
+ for (PcPatientEntity patient : pumpRecords) {
|
|
|
|
|
+ String json = JSONUtil.toJsonPrettyStr(patient);
|
|
|
|
|
+ Message message = new Message(json.getBytes());
|
|
|
|
|
+ try {
|
|
|
|
|
+ rabbitMqListener.patientQueue(message,null);
|
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ count.incrementAndGet();
|
|
|
|
|
+ System.out.println("=====================已处理" + count.get() + "条数据");
|
|
|
|
|
+ }
|
|
|
|
|
+ System.out.println("======================处理完毕住院号 " + arrays.size() + "的数据,共"+records.size()+"条");
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Test
|
|
|
|
|
+ public void insertEval(){
|
|
|
|
|
+ String read = IoUtil.read(FileUtil.getReader(cn.hutool.core.io.FileUtil.file(evalRecord), Charset.defaultCharset()));
|
|
|
|
|
+ JSONObject parse = JSONUtil.parseObj(read,true);
|
|
|
|
|
+ System.out.println("======================文件读取结束,开始解析======================");
|
|
|
|
|
+ JSONArray arrays = parse.getJSONArray("RECORDS");
|
|
|
|
|
+ Map<String, List<EvalInfo>> recordMaps = arrays.parallelStream().map(json -> {
|
|
|
|
|
+ return JSONUtil.toBean(json.toString(), EvalInfo.class);
|
|
|
|
|
+ }).filter(record-> StrUtil.isNotEmpty(record.getPumpCode()))
|
|
|
|
|
+ .collect(Collectors.groupingBy(EvalInfo::getPumpCode));
|
|
|
|
|
+ recordMaps.values()
|
|
|
|
|
+ .forEach(records->{
|
|
|
|
|
+ System.out.println("======================开始处理住院号 " + CollectionUtil.getLast(records).getPumpCode() + "的数据,共"+records.size()+"条");
|
|
|
|
|
+ List<PcAnalgesicScoreEntity> evalRecords = records.stream().map(EvalInfo::toEval).collect(Collectors.toList());
|
|
|
|
|
+ for (PcAnalgesicScoreEntity evalRecord : evalRecords) {
|
|
|
|
|
+ String json = JSONUtil.toJsonPrettyStr(evalRecord);
|
|
|
|
|
+ Message message = new Message(json.getBytes());
|
|
|
|
|
+ try {
|
|
|
|
|
+ rabbitMqListener.analgesicScoreQueue(message,null);
|
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ System.out.println("======================处理完毕住院号 " + arrays.size() + "的数据,共"+records.size()+"条");
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Data
|
|
|
|
|
+ public static class EvalInfo{
|
|
|
|
|
+ private String Patient_ID;
|
|
|
|
|
+ private String USER_2;
|
|
|
|
|
+ private Integer RightArm;
|
|
|
|
|
+ private String USER_1;
|
|
|
|
|
+ private String PatientCode;
|
|
|
|
|
+ private String SysProduct_ID;
|
|
|
|
|
+ private Integer Satisfaction;
|
|
|
|
|
+ private Integer Activity;
|
|
|
|
|
+ private Integer BreathDepression;
|
|
|
|
|
+ private Integer Vertigo;
|
|
|
|
|
+ private Integer Itch;
|
|
|
|
|
+ private String Iden_1;
|
|
|
|
|
+ private String Iden_2;
|
|
|
|
|
+ private Integer Uroschesis;
|
|
|
|
|
+ private String FollowUp;
|
|
|
|
|
+ private Integer Nausea_Vomit;
|
|
|
|
|
+ private Integer Calm;
|
|
|
|
|
+ private Integer LeftLeg;
|
|
|
|
|
+ private String SysHospital_ID;
|
|
|
|
|
+ private String BillDate;
|
|
|
|
|
+ private Integer Hoarseness;
|
|
|
|
|
+ private Integer SoreThroat;
|
|
|
|
|
+ private Integer Cognition_Obstacle;
|
|
|
|
|
+ private String AnalgesicScore_ID;
|
|
|
|
|
+ private Integer LeftArm;
|
|
|
|
|
+ private Integer RightLeg;
|
|
|
|
|
+ private String PumpCode;
|
|
|
|
|
+ private String Number_2;
|
|
|
|
|
+ private String IsDelete;
|
|
|
|
|
+ private Integer Static;
|
|
|
|
|
+ private String ROWID;
|
|
|
|
|
+ private String Other;
|
|
|
|
|
+ private BigDecimal SBP;
|
|
|
|
|
+ private BigDecimal DBP;
|
|
|
|
|
+ private BigDecimal HR;
|
|
|
|
|
+ private BigDecimal RR;
|
|
|
|
|
+ private BigDecimal SpO2;
|
|
|
|
|
+ public PcAnalgesicScoreEntity toEval(){
|
|
|
|
|
+ PcAnalgesicScoreEntity eval = new PcAnalgesicScoreEntity();
|
|
|
|
|
+ eval.setPatientId(getPatient_ID());
|
|
|
|
|
+ eval.setPumpCode(getPumpCode());
|
|
|
|
|
+ eval.setHospitalCode(getSysHospital_ID());
|
|
|
|
|
+ eval.setPatientCode(getPatientCode());
|
|
|
|
|
+ eval.setStatics(getStatic());
|
|
|
|
|
+ eval.setActivity(getActivity());
|
|
|
|
|
+ eval.setCalm(getCalm());
|
|
|
|
|
+ eval.setLeftArm(getLeftArm());
|
|
|
|
|
+ eval.setLeftLeg(getLeftLeg());
|
|
|
|
|
+ eval.setRightArm(getRightArm());
|
|
|
|
|
+ eval.setRightLeg(getRightLeg());
|
|
|
|
|
+ eval.setNauseaVomit(getNausea_Vomit());
|
|
|
|
|
+ eval.setItch(getItch());
|
|
|
|
|
+ eval.setVertigo(getVertigo());
|
|
|
|
|
+ eval.setSoreThroat(getSoreThroat());
|
|
|
|
|
+ eval.setUroschesis(getUroschesis());
|
|
|
|
|
+ eval.setBreathDepression(getBreathDepression());
|
|
|
|
|
+ eval.setHoarseness(getHoarseness());
|
|
|
|
|
+ eval.setCognitionObstacle(getCognition_Obstacle());
|
|
|
|
|
+ eval.setOther(getOther());
|
|
|
|
|
+ eval.setSatisfaction(getSatisfaction());
|
|
|
|
|
+ if (StrUtil.isNotEmpty(getBillDate())) {
|
|
|
|
|
+ DateTime dateTime = DateUtil.parse(getBillDate(),"dd/MM/yyyy HH:mm:ss");
|
|
|
|
|
+ eval.setFollowDate(dateTime);
|
|
|
|
|
+ }
|
|
|
|
|
+ eval.setCreator(getFollowUp());
|
|
|
|
|
+ eval.setProductCode(getSysProduct_ID());
|
|
|
|
|
+ eval.setAnalgesicScoreId(getAnalgesicScore_ID());
|
|
|
|
|
+ eval.setSBP(getSBP());
|
|
|
|
|
+ eval.setDBP(getDBP());
|
|
|
|
|
+ eval.setHR(getHR());
|
|
|
|
|
+ eval.setRR(getRR());
|
|
|
|
|
+ eval.setSpO2(getSpO2());
|
|
|
|
|
+ return eval;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Data
|
|
|
|
|
+ public static class PatientInfo{
|
|
|
|
|
+ private String Patient_ID;
|
|
|
|
|
+ private String USER_2;
|
|
|
|
|
+ private String USER_1;
|
|
|
|
|
+ private String PatientCode;
|
|
|
|
|
+ private String SysProduct_ID;
|
|
|
|
|
+ private String Sex;
|
|
|
|
|
+ private String Operation;
|
|
|
|
|
+ private String Name;
|
|
|
|
|
+ private String ASA;
|
|
|
|
|
+ private String EaseMode;
|
|
|
|
|
+ private String Remark;
|
|
|
|
|
+ private String DoctorTwo;
|
|
|
|
|
+ private String Formula;
|
|
|
|
|
+ private String Salt;
|
|
|
|
|
+ private String DestroyPerson;
|
|
|
|
|
+ private String BedNo;
|
|
|
|
|
+ private String Iden_1;
|
|
|
|
|
+ private String Iden_2;
|
|
|
|
|
+ private String AnesthesiaMode;
|
|
|
|
|
+ private String ConfigPerson;
|
|
|
|
|
+ private Integer Age;
|
|
|
|
|
+ private String WitnessPerson;
|
|
|
|
|
+ private String UndoPerson;
|
|
|
|
|
+ private String CreateTime;
|
|
|
|
|
+ private String UndoTime;
|
|
|
|
|
+ private String SysHospital_ID;
|
|
|
|
|
+ private String Doctor;
|
|
|
|
|
+ private String Weight;
|
|
|
|
|
+ private String Surgeon;
|
|
|
|
|
+ private String PumpCode;
|
|
|
|
|
+ private String Ward;
|
|
|
|
|
+ private String Number_2;
|
|
|
|
|
+ private String IsDelete;
|
|
|
|
|
+ private String ROWID;
|
|
|
|
|
+ private String Balance;
|
|
|
|
|
+
|
|
|
|
|
+ public PcPatientEntity toPatient(){
|
|
|
|
|
+ PcPatientEntity result = new PcPatientEntity();
|
|
|
|
|
+ result.setPatientId(getPatient_ID());
|
|
|
|
|
+ result.setHospitalCode("43332553109747f3857e1e434e1e2ef3");
|
|
|
|
|
+// result.setHospitalCode(getSysHospital_ID());
|
|
|
|
|
+ result.setProductCode(getSysProduct_ID());
|
|
|
|
|
+ result.setPatientCode(getPatientCode());
|
|
|
|
|
+ result.setPumpCode(getPumpCode());
|
|
|
|
|
+ result.setName(getName());
|
|
|
|
|
+ result.setSex(getSex());
|
|
|
|
|
+ result.setWeight(getWeight());
|
|
|
|
|
+ result.setAge(getAge());
|
|
|
|
|
+ result.setWardCode(getWard());
|
|
|
|
|
+ result.setBedCode(getBedNo());
|
|
|
|
|
+ result.setOperationName(getOperation());
|
|
|
|
|
+ result.setOperationDoctor(getSurgeon());
|
|
|
|
|
+ result.setAsa(getASA());
|
|
|
|
|
+ result.setEasyMode(getEaseMode());
|
|
|
|
|
+ result.setAnesthesiaDoctor1(getDoctor());
|
|
|
|
|
+ result.setAnesthesiaDoctor2(getDoctorTwo());
|
|
|
|
|
+ result.setAnesthesiaMode(getAnesthesiaMode());
|
|
|
|
|
+ result.setConfigPerson(getConfigPerson());
|
|
|
|
|
+// result.setFormula(getFormula());
|
|
|
|
|
+ result.setUndoPerson(getUndoPerson());
|
|
|
|
|
+ result.setDestoryPerson(getDestroyPerson());
|
|
|
|
|
+ result.setWitnessPerson(getWitnessPerson());
|
|
|
|
|
+ if(StrUtil.isNotEmpty(getUndoTime())){
|
|
|
|
|
+ DateTime dateTime = DateUtil.parse(getUndoTime(),"dd/MM/yyyy HH:mm:ss");
|
|
|
|
|
+ result.setUndoTime(new Date(dateTime.getTime()));
|
|
|
|
|
+ }
|
|
|
|
|
+ result.setSalt(getSalt());
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Data
|
|
|
|
|
+ public static class ReceiveRecord{
|
|
|
|
|
+ private String ROWID;
|
|
|
|
|
+ private String ReceiveRecord_ID;
|
|
|
|
|
+ private String PumpCode;
|
|
|
|
|
+ private String PatientCode;
|
|
|
|
|
+ private String LastUploadTime;
|
|
|
|
|
+ private String Ward;
|
|
|
|
|
+ private String BedNo;
|
|
|
|
|
+ private BigDecimal BalanceQuantity;
|
|
|
|
|
+ private BigDecimal ContinueQuantity;
|
|
|
|
|
+ private BigDecimal SelfQuantity;
|
|
|
|
|
+ private BigDecimal LockTime;
|
|
|
|
|
+ private BigDecimal InputQuantity;
|
|
|
|
|
+ private Integer TrueNum;
|
|
|
|
|
+ private Integer FalseNum;
|
|
|
|
|
+ private BigDecimal MaxQuantity;
|
|
|
|
|
+ private Integer FirstQuantity;
|
|
|
|
|
+ private BigDecimal SingleQuantity;
|
|
|
|
|
+ private Integer AllQuantity;
|
|
|
|
|
+ private Integer AllCount;
|
|
|
|
|
+ private BigDecimal PulseQuantity;
|
|
|
|
|
+ private Integer PulseLockTime;
|
|
|
|
|
+ private Integer FirstLockTime;
|
|
|
|
|
+ private BigDecimal UpperLimit;
|
|
|
|
|
+ private BigDecimal LowerLimit;
|
|
|
|
|
+ private Integer CustomScate;
|
|
|
|
|
+ private Integer AddTrueFrequency;
|
|
|
|
|
+ private BigDecimal FilingCycle;
|
|
|
|
|
+ private BigDecimal ReductionPeriod;
|
|
|
|
|
+ private Integer RunState;
|
|
|
|
|
+ private Integer BUFState1;
|
|
|
|
|
+ private Integer BUFState2;
|
|
|
|
|
+ private Integer BUFState3;
|
|
|
|
|
+ private Integer BUFState4;
|
|
|
|
|
+ private Integer BUFState5;
|
|
|
|
|
+ private Integer BUFState6;
|
|
|
|
|
+ private Integer BUFState7;
|
|
|
|
|
+ private Integer BUFState8;
|
|
|
|
|
+ private Integer BUFState9;
|
|
|
|
|
+ private Integer Score;
|
|
|
|
|
+ private String StartTime;
|
|
|
|
|
+ private String ViewState;
|
|
|
|
|
+ private String StateFlag;
|
|
|
|
|
+ private Integer CallFlag;
|
|
|
|
|
+ private String NoSignal;
|
|
|
|
|
+ private String Remark;
|
|
|
|
|
+ private String IsDelete;
|
|
|
|
|
+ private String Number_2;
|
|
|
|
|
+ private String Iden_1;
|
|
|
|
|
+ private String Iden_2;
|
|
|
|
|
+ private String USER_1;
|
|
|
|
|
+ private String USER_2;
|
|
|
|
|
+ private String SysHospital_ID;
|
|
|
|
|
+ private String SysProduct_ID;
|
|
|
|
|
+
|
|
|
|
|
+ private boolean remove=true;
|
|
|
|
|
+ public PcPumpEntity toPcPump(){
|
|
|
|
|
+ PcPumpEntity result = new PcPumpEntity();
|
|
|
|
|
+ result.setPumpCode(getPumpCode());
|
|
|
|
|
+ result.setProductCode(getSysProduct_ID());
|
|
|
|
|
+ result.setHospitalCode("43332553109747f3857e1e434e1e2ef3");
|
|
|
|
|
+// result.setHospitalCode(getSysHospital_ID());
|
|
|
|
|
+ result.setPatientCode(getPatientCode());
|
|
|
|
|
+ result.setRemainQuantity(getBalanceQuantity());
|
|
|
|
|
+ result.setContinueQuantity(getContinueQuantity());
|
|
|
|
|
+ result.setSelfControlQuantity(getSelfQuantity());
|
|
|
|
|
+ result.setLockTime(getLockTime());
|
|
|
|
|
+ result.setInputQuantity(getInputQuantity());
|
|
|
|
|
+ result.setValidTime(getTrueNum());
|
|
|
|
|
+ result.setInvalidTime(getFalseNum());
|
|
|
|
|
+ result.setMaxQuantity(getMaxQuantity());
|
|
|
|
|
+ result.setFirstQuantity(getFirstQuantity());
|
|
|
|
|
+ result.setSingleQuantity(getSingleQuantity());
|
|
|
|
|
+ result.setTotalQuantity(getAllQuantity());
|
|
|
|
|
+ result.setTotalCount(getAllCount());
|
|
|
|
|
+ result.setPulseQuantity(getPulseQuantity());
|
|
|
|
|
+ result.setPulseLockTime(getPulseLockTime());
|
|
|
|
|
+ result.setFirsLockTime(getFirstLockTime());
|
|
|
|
|
+ result.setUpperLimit(getUpperLimit());
|
|
|
|
|
+ result.setLowerLimit(getLowerLimit());
|
|
|
|
|
+ result.setCustomScate(getCustomScate());
|
|
|
|
|
+ result.setAddValidTime(getAddTrueFrequency());
|
|
|
|
|
+ result.setRunState(getRunState());
|
|
|
|
|
+ result.setBufState1(getBUFState1());
|
|
|
|
|
+ result.setBufState2(getBUFState2());
|
|
|
|
|
+ result.setBufState3(getBUFState3());
|
|
|
|
|
+ result.setBufState4(getBUFState4());
|
|
|
|
|
+ result.setBufState5(getBUFState5());
|
|
|
|
|
+ result.setBufState6(getBUFState6());
|
|
|
|
|
+ result.setBufState7(getBUFState7());
|
|
|
|
|
+ result.setBufState8(getBUFState8());
|
|
|
|
|
+ result.setBufState9(getBUFState9());
|
|
|
|
|
+ result.setScore(getScore());
|
|
|
|
|
+ result.setAddCycle(getFilingCycle());
|
|
|
|
|
+ result.setReduceCycle(getReductionPeriod());
|
|
|
|
|
+
|
|
|
|
|
+ result.setCallFlag(getCallFlag());
|
|
|
|
|
+
|
|
|
|
|
+ result.setViewState(getViewState());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ //todo
|
|
|
|
|
+ result.setRemove(isRemove());
|
|
|
|
|
+ DateTime dateTime = DateUtil.parse(getLastUploadTime(),"dd/MM/yyyy HH:mm:ss");
|
|
|
|
|
+
|
|
|
|
|
+ result.setLastUploadTime(dateTime.getTime()/1000);
|
|
|
|
|
+ return result;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|