演示视频
君生我未生,我生君已老,这里是java信创频道JRT,真信创-不糊弄。
基础架构决定上层建筑,和给有些品种的植物种植一样,品种不对,施肥浇水再多,也是不可能长成参天大树的。JRT吸收了各方优点,在1.9G内存下服务器运行数据库和Web,业务数据有170多万的情况下查询年报能跑到1秒以内。
Spring+Radis+maven还有什么说的吗?用实际行动证明JRT方案的可行性,不光开发速度快、部署简单、依赖少、占用资源少、连性能也要击败他。java圈子还不如C#的好,C#起码造轮子没人反驳,java里面不用Spring就是异类,连设计框架的勇气都没有。
满满的特色脚本代码
import JRT.Core.Dto.CmdDto;
import JRT.Core.Dto.OutValue;
import JRT.Core.Util.LogUtils;
import JRT.Core.Util.MakeCmdUtil;
import JRT.Model.Bussiness.Parameters;
import JRTBLLBase.BaseHttpHandlerMachine;
import JRTBLLBase.Helper;import java.util.ArrayList;
import java.util.List;/*** 希森美康XN9000仪器接口,批量插入数据*/
public class miXN9000Lot extends BaseHttpHandlerMachine {/*** 流水号*/private static String dataEpis = "";/*** 数据的日期*/private static int date = Helper.GetNowDate();/*** 数据的时间*/private static int time = Helper.GetNowTime();/*** 缓存结果*/private static String result = "";/*** 保存仪器数据** @param Param 参数* @param Session* @param Output* @return* @throws Exception*/public String SaveData(Parameters Param, OutValue Session, OutValue Output) throws Exception {String mi = Param.P0;String data = Param.P1;String epis = Param.P2;String fileName = Param.P3;String DBColName = Param.P4;Trace(mi, data, "M->H");//读取文件到第几行数据int index = Helper.ValidParam(Param.P5, -1);//返回的数据List<CmdDto> cmdList = new ArrayList<>();try {String[] arr = data.split(",");//第一行解析流水号和结果日期时间if (arr[0].equals("0")) {String dateStr = arr[1];date = Helper.DateToInt(dateStr);String timeStr = arr[2];time = Helper.TimeToInt(timeStr);dataEpis = arr[3];result = "";}//解析结果else if (arr[0].equals("1")) {String chl = arr[1];String res = arr[3];result += chl + "\\" + res + ",";}//解析图片else if (arr[0].equals("3")) {String imgClass = arr[2];String imgPath = arr[3];//取图MakeCmdUtil.AddGetImageCmd(cmdList, dataEpis, imgClass, imgPath, "");//删图//MakeCmdUtil.AddRMCmd(cmdList,imgPath);}//最后一行保存结果if (index == -1 && !dataEpis.isEmpty()) {Trace(mi, result, "解析结果");//循环生成几年的数据List<Integer> dateList=Helper.GetDatesBetween(20100101,20120101);for(Integer day:dateList) {//处理数据Helper.GetBllMethodData("mi.miBase", "SaveResult", mi, dataEpis, result, day, time);}}Trace(mi, "解析完成", "M->H");} catch (Exception ex) {LogUtils.WriteExceptionLog("解析XN9000仪器结果发生错误", ex);}return Helper.Object2Json(cmdList);}/*** 得到文件服务地址供接口上传图片** @param Param* @param Session* @param Output* @return* @throws Exception*/public String GetFileService(Parameters Param, OutValue Session, OutValue Output) throws Exception {String mi = Param.P0;String path = (String) Helper.GetBllMethodData("mi.miBase", "GetFileService", mi);//返回文件服务路径return path;}/*** 保存文件到数据库** @param Param* @param Session* @param Output* @return* @throws Exception*/public String SaveImage(Parameters Param, OutValue Session, OutValue Output) throws Exception {String mi = Param.P0;String epis = Param.P1;String ImageClass = Param.P2;String fileName = Param.P3;String fullName = Param.P4;String caption = "";String displayRatio = "";String width = "";String height = "";String sequence = "";Integer receiveDate = null;String ret = (String) Helper.GetBllMethodData("mi.miBase", "SaveImage", mi, epis, ImageClass, "", fileName, null, caption, displayRatio, width, height, sequence);return ret;}/*** 查询要上传的指令** @param Param* @param Session* @param Output* @return* @throws Exception*/public String QryUpdata(Parameters Param, OutValue Session, OutValue Output) throws Exception {String mi = Param.P0;//先写Log测试LogUtils.WriteDebugLog("mi:" + mi + ",调用上传查询");//返回的数据List<CmdDto> cmdList = new ArrayList<>();return Helper.Object2Json(cmdList);}/*** 设置上传指令执行状态** @param Param* @param Session* @param Output* @return* @throws Exception*/public String SetQryStatus(Parameters Param, OutValue Session, OutValue Output) throws Exception {String mi = Param.P0;String setStatusKey = Param.P1;//先写Log测试LogUtils.WriteDebugLog("mi:" + mi + ",setStatusKey:" + setStatusKey + "设置状态");return "";}}