|
|
@@ -93,9 +93,63 @@ public class StepWorkServiceImpl implements StepWorkService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public StepWorkApiResult<Map<String,Object>> UploadThruputLog(HttpServletRequest request , String data) {
|
|
|
+ public StepWorkApiResult<Map<String,Object>> UploadThruputLog(HttpServletRequest request, String data) {
|
|
|
+ Map<Object,Object> map = BaseUtil.parseFormStoreToMap(data);
|
|
|
+ String SN = map.get("sequenceNumber").toString();
|
|
|
+ String WO = map.get("workOrderNo").toString();
|
|
|
+ String stationCode = map.get("stationCode").toString();
|
|
|
+ String routeCode = map.get("routeCode").toString();
|
|
|
+ String eventResult = map.get("eventResult").toString();
|
|
|
+ try{
|
|
|
+ String testName = Objects.toString(baseDao.getFieldDataByCondition("make,prodtestparam","pp_stepname","ma_code = '"+WO+"' AND pp_prodcode = ma_prodcode AND pp_stepcode = '"+routeCode+"'"),"");
|
|
|
+ if(testName.isEmpty()){
|
|
|
+ return new StepWorkApiResult(false,500,"工单:"+WO+"未维护测试参数列表");
|
|
|
+ }
|
|
|
+
|
|
|
+ int sdId = baseDao.getSeqId("steptestdata_seq");
|
|
|
+ Object testDataObj = map.get("TestData");
|
|
|
+ if (testDataObj instanceof List) {
|
|
|
+ List<Object> testDataList = (List<Object>) testDataObj;
|
|
|
+ for (Object item : testDataList) {
|
|
|
+ if (item instanceof Map) {
|
|
|
+ Map<Object, Object> testDataMap = (Map<Object, Object>) item;
|
|
|
+ String testItem = Objects.toString(testDataMap.get("testItem"),"");
|
|
|
+ String threshold = Objects.toString(testDataMap.get("threshold"),"");
|
|
|
+ String actualValue = Objects.toString(testDataMap.get("actualValue"),"");
|
|
|
+ String result = Objects.toString(testDataMap.get("result"),"");
|
|
|
+ String paramName = Objects.toString(testDataMap.get("paramName"),"");
|
|
|
+ String duration = Objects.toString(testDataMap.get("duration"),"");
|
|
|
+ String description = Objects.toString(testDataMap.get("description"),"");
|
|
|
+
|
|
|
+ if(!baseDao.checkIf("prodtestparam,make","pp_prodcode=ma_prodcode AND ma_code='"+WO+"' AND pp_stepname='"+testName+"' AND pp_testitem='"+testItem+"'")){
|
|
|
+ return new StepWorkApiResult(false,500,"工单:"+WO+"测试参数列表,测试项目中参数名称无"+ testItem);
|
|
|
+ }
|
|
|
+
|
|
|
+ String sql = "INSERT INTO steptestdatadet( sdd_id, sdd_detno, sdd_sdid, sdd_sncode, sdd_makecode, " +
|
|
|
+ "sdd_resultdesc, sdd_testitem, sdd_pmenxdesc, sdd_result, sdd_paramname, " +
|
|
|
+ "sdd_testtime, sdd_value, sdd_okmin, sdd_okmax) " +
|
|
|
+ "SELECT steptestdatadet_seq.NEXTVAL, pp_detno, '"+sdId+"', '"+SN+"', ma_code, " +
|
|
|
+ "'"+description+"', pp_testitem, pp_menxdesc, '"+result+"', pp_paramname, " +
|
|
|
+ "pp_testtimes, '"+actualValue+"', pp_okmin, pp_okmax " +
|
|
|
+ "FROM prodtestparam, make WHERE pp_prodcode = ma_prodcode " +
|
|
|
+ "AND ma_code = '"+WO+"' AND pp_stepname = '吞吐量测试' AND pp_testitem = '"+testItem+"'";
|
|
|
+ baseDao.execute(sql);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ baseDao.execute("INSERT INTO steptestdata(sd_id, sd_sn, sd_makecode, sd_stepcode, " +
|
|
|
+ "sd_sccode, sd_result, sd_indate, sd_recorddate) " +
|
|
|
+ "SELECT "+sdId+", '"+SN+"', '"+WO+"', sc_stepcode, " +
|
|
|
+ "'"+routeCode+"', '"+eventResult+"', sysdate, sysdate FROM source WHERE sc_code = '"+stationCode+"'");
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }catch (Exception ex){
|
|
|
+ return new StepWorkApiResult(false,500,"记录失败:" + ex.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
insertLogger(data,"UploadThruputLog");
|
|
|
- return new StepWorkApiResult(true,200,"上传MES测试信息成功");
|
|
|
+ return new StepWorkApiResult(true,200,"上传MES测试信息成功");
|
|
|
}
|
|
|
|
|
|
/**
|