public void AnalysisBizFileToSubmit(string file, string pid) { DateTime?createtime = null; // 创建时间 DateTime?djsj = null; // 登记时间 DateTime?slsj = null; // 受理时间 DateTime?zxsj = null; // 注销时间 string ajzt = null; // 案件状态 string qszt = null; // 权属装填 string djxl = null; // 登记类型名称 Head head = XMLHelper.GetBizHeadInfo(file); RNANDCN rnandcn = new RNANDCN(); MSGTIMERECORD mtd = new MSGTIMERECORD(); RnandcnManager rm = new RnandcnManager(); MsgmanageManager mgr = new MsgmanageManager(); // JK库的MSGMANAGE表 MsgtimerecordManager mdr = new MsgtimerecordManager(); HolidayManager hgr = new HolidayManager(); string today = head.CreateDate.ToString("yyyyMMddhhmmss"); //string today2 = "20191018"; ICollection <RNANDCN> list = rm.Query("select * from RNANDCN where realeunum = '" + head.PreEstateNum + "' and ywh='" + head.RecFlowID + "' and to_char(createtime,'yyyyMMddhhmiss') = '" + today + "' "); MSGMANAGE msg = mgr.Query("select * from MSGMANAGE WHERE ESTATENUM ='" + head.PreEstateNum + "' and recflowid = '" + head.RecFlowID + "' and to_char(CREATEDATE,'yyyyMMddhhmiss') = '" + today + "'").ToList().FirstOrDefault(); if (msg != null) { mtd.UPTIME = msg.UPTIME; //上传时间 mtd.UPSTATUS = Convert.ToString(msg.UPSTATUS); //报文状态 } if (list.Count == 0) { InsertRNANDCN(pid, rnandcn, head, ref createtime); List <dynamic> entities = GetSmtInstance(file, head, ref djsj, ref slsj, ref zxsj, ref ajzt, ref qszt, ref djxl); string[] entityName = GetBizDataSonNodeName(file).ToArray(); int index = 0; foreach (var entity in entities) { EntityManager em = new EntityManager(); em.Insert(entityName[index], "PID", false, entity); index++; } mtd.DJSJ = djsj; mtd.SLSJ = slsj; mtd.ZXSJ = zxsj; mtd.AJZT = ajzt; mtd.QSZT = qszt; mtd.DJXL = djxl; //HOLIDAY holiday = hgr.Query("SELECT * FROM HOLIDAY WHERE TO_CHAR(DAY,'yyyyMMdd') = "+ today + "").FirstOrDefault(); //if (holiday!=null) //{ // mtd.ISHOLIDAY = holiday.STATUS; //} if ("2".Equals(qszt) && slsj != null && zxsj != null) { mtd.ISHOLIDAY = CompareDate((DateTime)slsj, (DateTime)zxsj, hgr)[0]; mtd.INTERVAL = CompareDate((DateTime)slsj, (DateTime)zxsj, hgr)[1]; mtd.DVALUE = CompareDate((DateTime)slsj, (DateTime)zxsj, hgr)[2]; } else if (slsj != null && djsj != null) { mtd.ISHOLIDAY = CompareDate((DateTime)slsj, (DateTime)djsj, hgr)[0]; mtd.INTERVAL = CompareDate((DateTime)slsj, (DateTime)djsj, hgr)[1]; mtd.DVALUE = CompareDate((DateTime)slsj, (DateTime)djsj, hgr)[2]; } InsertMSGTIMERECORD(pid, mtd, head); } else { //根据JK库报文状态,实时更新。 MSGTIMERECORD msgtd = mdr.Query("select * from MSGTIMERECORD WHERE BDCDYH ='" + head.PreEstateNum + "'and ywh = '" + head.RecFlowID + "' and to_char(CREATETIME,'yyyyMMddhhmiss') = '" + today + "'").ToList().FirstOrDefault(); if (msgtd != null) { msgtd.UPSTATUS = mtd.UPSTATUS; UpdateMSGTIMERECORD(msgtd); } } }