78216f4415d93c3e0ffa2c3e1f0e51137f172a88.svn-base 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453
  1. package QCM.JHY01.JHY0102;
  2. import java.math.BigDecimal;
  3. import java.sql.ResultSet;
  4. import java.sql.SQLException;
  5. import java.util.HashMap;
  6. import java.util.List;
  7. import java.util.TreeSet;
  8. import org.apache.commons.lang.StringUtils;
  9. import org.apache.ibatis.session.SqlSession;
  10. import com.alibaba.fastjson.JSON;
  11. import com.alibaba.fastjson.JSONArray;
  12. import com.alibaba.fastjson.JSONObject;
  13. import CoreFS.SA01.CoreIComponent;
  14. import CoreFS.SA06.CoreReturnObject;
  15. import QCM.COMMUNAL.QCM02.SqlJoint;
  16. import QCM.COMMUNAL.VO.QcmJudgeOperateLog;
  17. import QCM.JHY01.JHY0101.QuerryQltySample;
  18. import UIB.COM.TechDcsResult;
  19. import UIB.COM.XmlSqlParsersFactory;
  20. public class QuerryJhyQtly extends CoreIComponent{
  21. CoreReturnObject cro = new CoreReturnObject();
  22. SqlSession SqlSession = QCM.COMMUNAL.SqlSessionBuilder.openSqlSession();
  23. QCM.COMMUNAL.OrderSqMapper mapper = SqlSession.getMapper(QCM.COMMUNAL.OrderSqMapper.class);
  24. public String StrSky(String begintime,String endtime){
  25. String sql = "select (to_date('"+endtime+"','yyyy-MM-dd') - to_date('"+begintime+"','yyyy-MM-dd')) SKY from dual";
  26. HashMap list = mapper.queryOne(sql);
  27. Double ble = Double.parseDouble(list.get("SKY").toString());
  28. String tstr="FALSE";
  29. if(ble>=0 && ble <=30 ){
  30. tstr="TRUE";
  31. }
  32. return tstr;
  33. }
  34. /**
  35. * 根据条件查询材质检验实绩
  36. * @param gradeName
  37. * @param heatNo
  38. * @return
  39. */
  40. public CoreReturnObject Query(String batchNo,String batchNo2,String design_key,String psc_desc,String startTime,String endTime,
  41. String pline_name,String dateTimeName,String materialNo) {
  42. if (!SqlJoint.IsNullOrSpace(startTime) && !SqlJoint.IsNullOrSpace(endTime)) {
  43. String sky=StrSky(startTime,endTime);
  44. if(sky.equals("FALSE")){
  45. SqlSession.close();
  46. cro.setV_errCode(-1);
  47. cro.setV_errMsg("查询时间不能大于30天,请核实查询时间条件!");
  48. return cro;
  49. }
  50. }
  51. String sql = "select ord.DESIGN_KEY, "
  52. +" ord.SMP_NO, "
  53. +" ord.PSC, "
  54. +" ord.PSC_DESC, "
  55. +" ord.HEAT_NO, "
  56. +" ord.BATCH_NO, "
  57. +" ord.INSPECTION_LOT, "
  58. +" ord.DELIVERY_STATE_CODE, "
  59. +" ord.DELIVERY_STATE_DESC, "
  60. +" to_char(ord.THICK, 'fm990.099') THICK, "
  61. +" ord.WIDTH, "
  62. +" ord.LENGTH, "
  63. +" ord.PLINE_CODE, "
  64. +" ord.PLINE_NAME, "
  65. +" ord.MSC_PLINE, "
  66. +" ord.CERT_INST_CODE, "
  67. +" ord.CERT_INST_NAME, "
  68. +" ord.SMP_TYPE_CODE, "
  69. +" ord.SMP_TYPE_NAME, "
  70. +" ord.PROD_NAME, "
  71. +" ord.STEEL_NAME, "
  72. +" ord.STD_NAME, "
  73. +" ord.SMELTING_CNT, "
  74. +" ord.PRODUCT_CNT, "
  75. +" ord.ASSAY_NO_CP, "
  76. +" ord.ASSAY_NO_RL, "
  77. +" ord.CIC_ID, "
  78. +" ord.PHY_ID, "
  79. +" ord.JUDGE_STATUS, "
  80. +" ord.JUDGE_RESULT_DESC, "
  81. +" ord.JUDGE_NAME, "
  82. +" to_char(ord.JUDGE_TIME, 'yyyy-MM-dd hh24:mi:ss') JUDGE_TIME, "
  83. +" ord.JUDGE_MEMO, "
  84. +" ord.CREATE_NAME, "
  85. +" to_char(ord.CREATE_TIME, 'yyyy-MM-dd hh24:mi:ss') CREATE_TIME, "
  86. +" to_char(d.send_time, 'yyyy-MM-dd hh24:mi:ss') 发送时间, "
  87. +" (select max(material_no) "
  88. +" from qcm_jhy_sample_consign_d a "
  89. +" where a.smp_no = ord.smp_no) 取样材料号, "
  90. +" (select decode(max(a.Smp_Type_Code), '1', '复样', '0', '初样') "
  91. +" from qcm_jhy_sample_consign_d a "
  92. +" where a.smp_no = ord.smp_no) 取样方式,d.PROCESS_NO,d.PROCESS_NOS,d.FREQ_NAME,d.SMP_LOCATION "
  93. +" FROM QCM_JHY_SAMPLE_R_ORD ord "
  94. +" inner join QCM_JHY_SAMPLE_CONSIGN_M m "
  95. +" on m.smp_no = ord.smp_no "
  96. +" inner join QCM_JHY_SAMPLE_CONSIGN_D d "
  97. +" on ord.smp_no = d.smp_no "
  98. +" WHERE 1 = 1 and d.STATUS <> 5 and d.STATUS <> 6 and ord.JUDGE_STATUS<>3 ";
  99. if (batchNo!=null && !"".equals(batchNo)
  100. && batchNo2!=null && !"".equals(batchNo2)) {
  101. sql +=" and upper(ord.batch_no) >= upper('"+batchNo+"')";
  102. sql +=" and upper(ord.batch_no) <= upper('"+batchNo2+"')";
  103. }else if(batchNo!=null && !"".equals(batchNo)
  104. && (batchNo2==null || "".equals(batchNo2)) ){
  105. sql +=" and ord.batch_no like '"+batchNo+"%' ";
  106. }
  107. if (pline_name!=null && !"".equals(pline_name) && !pline_name.equals("全部")) {
  108. if(pline_name.equals("高线")){
  109. sql +=" and ord.PLINE_NAME in ('高线','二线厂')";
  110. }else{
  111. sql +=" and ord.PLINE_NAME like '"+pline_name+"%'";
  112. }
  113. }
  114. if(!"".equals(design_key)){
  115. sql +=" and lower(ord.DESIGN_KEY) like lower('"+design_key+"%')";
  116. }
  117. if(!"".equals(psc_desc)){
  118. sql +=" and lower(ord.PSC_DESC) like lower('"+psc_desc+"%')";
  119. }
  120. if(!"".equals(materialNo)){
  121. sql +=" and lower(d.material_no) like lower('"+materialNo+"%')";
  122. }
  123. if (startTime!=null && !"".equals(startTime) && endTime !=null && !"".equals(endTime)) {
  124. if(dateTimeName.equals("判定时间")){
  125. sql +=" and ord.JUDGE_TIME>=to_date(concat('"+startTime+"',' 00:00:00'),'yyyy-MM-dd HH24:mi:ss')";
  126. sql +=" and ord.JUDGE_TIME<=to_date(concat('"+endTime+"',' 23:59:59'),'yyyy-MM-dd HH24:mi:ss') ";
  127. }else if(dateTimeName.equals("发送时间")){
  128. sql +=" and d.send_time>=to_date(concat('"+startTime+"',' 00:00:00'),'yyyy-MM-dd HH24:mi:ss')";
  129. sql +=" and d.send_time<=to_date(concat('"+endTime+"',' 23:59:59'),'yyyy-MM-dd HH24:mi:ss') ";
  130. }else{
  131. sql +=" and ord.CREATE_TIME>=to_date(concat('"+startTime+"',' 00:00:00'),'yyyy-MM-dd HH24:mi:ss')";
  132. sql +=" and ord.CREATE_TIME<=to_date(concat('"+endTime+"',' 23:59:59'),'yyyy-MM-dd HH24:mi:ss') ";
  133. }
  134. }
  135. sql +=" order by ord.BATCH_NO desc";
  136. cro=this.getDao("testDao").ExcuteQuery(sql.toString());
  137. return cro;
  138. }
  139. /**
  140. * 查询材质检验项目信息
  141. * @param parmas
  142. * @return
  143. * @throws SQLException
  144. */
  145. /* public CoreReturnObject getQltySampleItem(String smp_no) throws SQLException {
  146. try{
  147. StringBuffer sqlucomm = new StringBuffer();
  148. sqlucomm.append("SELECT SPECIMEN_NO,SEQ,SMP_NO,PHY_NAME_L,PHY_CODE_L,PHY_CODE_M,PHY_NAME_M,");
  149. sqlucomm.append("PHY_CODE_S,PHY_NAME_S,ITEM_CODE_D,ITEM_NAME_D,ITEM_CODE_T,ITEM_NAME_T,ITEM_CODE_S,ITEM_NAME_S,");
  150. sqlucomm.append("ISJUDGE,JUDGE_BASIS,PHY_UNIT,GROUP_SEQ,QUOTE_SPECIMEN_NO,QUOTE_SEQ,MEMO,TEST_QTY,");
  151. sqlucomm.append(" CREATE_NAME,CREATE_TIME FROM QCM_JHY_SAMPLE_CONSIGN_D_ITEM WHERE SMP_NO='"+smp_no+"'");
  152. ResultSet results=this.getDao("KgDao").ExceuteQueryForResultSet(sqlucomm.toString());
  153. JSONArray jsonArray=QuerryQltySample.resultSetToJsonArry(results);
  154. results.close();
  155. if (jsonArray!=null && jsonArray.size()>0){
  156. for (int i = 0; i < jsonArray.size(); i++) {
  157. JSONObject result = (JSONObject)jsonArray.get(i);
  158. sqlucomm.setLength(0);
  159. sqlucomm.append("SELECT R.VAL1,R.VAL2,R.VAL3,R.AVG_VAL,R.MAX_VAL,R.MIN_VAL,R.ITEM_CODE_L,R.ITEM_DESC_L from QCM_JHY_INSP_PHYSICS R where R.SPECIMEN_NO='"+result.get("SPECIMEN_NO")+"' ");
  160. sqlucomm.append(" AND R.PHY_CODE_L='"+result.get("PHY_CODE_L")+"' AND R.PHY_CODE_M='"+result.get("PHY_CODE_M")+"' AND R.PHY_CODE_S='"+result.get("PHY_CODE_S")+"'");
  161. if (result.getString("ITEM_CODE_D")==null && !"".equals(result.getString("ITEM_CODE_D"))) {
  162. sqlucomm.append(" AND R.ITEM_CODE_D='"+result.get("ITEM_CODE_D")+"' ");
  163. }
  164. if (result.getString("ITEM_CODE_T")==null && !"".equals(result.getString("ITEM_CODE_T"))) {
  165. sqlucomm.append(" AND R.ITEM_CODE_T='"+result.get("ITEM_CODE_T")+"' ");
  166. }
  167. if (result.getString("ITEM_CODE_S")==null && !"".equals(result.getString("ITEM_CODE_S"))) {
  168. sqlucomm.append(" AND R.ITEM_CODE_S='"+result.get("ITEM_CODE_S")+"' ");
  169. }
  170. ResultSet quoteResults=this.getDao("KgDao").ExceuteQueryForResultSet(sqlucomm.toString());//QUOTE_SPECIMEN_NO QUOTE_SEQ
  171. JSONArray jsonArray2=QuerryQltySample.resultSetToJsonArry(quoteResults);
  172. quoteResults.close();
  173. if (jsonArray2!=null && jsonArray2.size()>0){
  174. JSONObject jsonQuote=(JSONObject)jsonArray2.get(0);
  175. result.put("VAL1", jsonQuote.get("VAL1"));
  176. result.put("VAL2", jsonQuote.get("VAL2"));
  177. result.put("VAL3", jsonQuote.get("VAL3"));
  178. result.put("AVG_VAL", jsonQuote.get("AVG_VAL"));
  179. result.put("MAX_VAL", jsonQuote.get("MAX_VAL"));
  180. result.put("MIN_VAL", jsonQuote.get("MIN_VAL"));
  181. result.put("ITEM_CODE_L", jsonQuote.get("ITEM_CODE_L"));
  182. result.put("ITEM_DESC_L", jsonQuote.get("ITEM_DESC_L"));
  183. }
  184. }
  185. cro.setResult(jsonArray);
  186. }
  187. }catch(Exception e){
  188. e.printStackTrace();
  189. }
  190. return cro;
  191. }*/
  192. //String pline_code
  193. public CoreReturnObject getQltySampleItem(String smp_no) throws SQLException {
  194. String sql =" SELECT d.PROCESS_NOS 热处理号,t.SPECIMEN_NO, "
  195. +" t.SEQ, "
  196. +" t.SMP_NO, "
  197. +" t.PHY_NAME_L, "
  198. +" t.PHY_CODE_L, "
  199. +" t.PHY_CODE_M, "
  200. +" t.PHY_NAME_M, "
  201. +" t.PHY_CODE_S, "
  202. +" t.PHY_NAME_S, "
  203. +" t.ITEM_CODE_D, "
  204. +" t.ITEM_NAME_D, "
  205. +" t.ITEM_CODE_T, "
  206. +" t.ITEM_NAME_T, "
  207. +" t.ITEM_CODE_S, "
  208. +" t.ITEM_NAME_S, "
  209. +" t.ISJUDGE, "
  210. +" t.JUDGE_BASIS, "
  211. +" t.PHY_UNIT, "
  212. +" t.GROUP_SEQ, "
  213. +" t.QUOTE_SPECIMEN_NO, "
  214. +" t.QUOTE_SEQ, "
  215. +" t.MEMO, "
  216. +" t.TEST_QTY, "
  217. +" t.CREATE_NAME, "
  218. +" to_char(t.CREATE_TIME, 'yyyy-MM-dd hh24:mi:ss') CREATE_TIME, "
  219. +" r.VAL1, "
  220. +" r.VAL2, "
  221. +" r.VAL3, "
  222. +" r.AVG_VAL, "
  223. +" r.MAX_VAL, "
  224. +" r.MIN_VAL, "
  225. +" r.ITEM_CODE_L, "
  226. +" r.ITEM_DESC_L, "
  227. +" (select max(material_no) "
  228. +" from qcm_jhy_sample_consign_d a "
  229. +" where a.specimen_no = t.specimen_no) 取样产品序号, "
  230. +" decode(t.FY_QUOTE_SPECIMEN_NO, "
  231. +" null, "
  232. +" (select decode(max(a.Smp_Type_Code), '1', '复样', '0', '初样') "
  233. +" from qcm_jhy_sample_consign_d a "
  234. +" where a.specimen_no = t.specimen_no), "
  235. +" '初样') FY_QUOTE_SPECIMEN_NO, "
  236. +"(select IS_PASS from QCM_JUDGE_PHYSICAL_RESULT q where t.SPECIMEN_NO = q.Specimen_No AND t.PHY_CODE_L = q.Phy_Code_l AND t.PHY_CODE_M = q.Phy_Code_m AND t.PHY_CODE_S = q.Phy_Code_s and rownum < = 1) IS_PASS"
  237. +" FROM QCM_JHY_SAMPLE_CONSIGN_D_ITEM t, QCM_JHY_INSP_PHYSICS r,QCM_JHY_SAMPLE_CONSIGN_D d "
  238. +" WHERE t.SPECIMEN_NO = r.Specimen_No(+) "
  239. +" and t.seq = r.seq(+) and t.specimen_no = d.specimen_no "
  240. +" AND t.PHY_CODE_L = r.Phy_Code_l(+) "
  241. +" AND t.PHY_CODE_M = r.Phy_Code_m(+) "
  242. +" AND t.PHY_CODE_S = r.Phy_Code_s(+) "
  243. +" and t.SMP_NO = '"+smp_no+"' "
  244. +" order by t.SEQ asc ";
  245. cro=this.getDao("testDao").ExcuteQuery(sql.toString());
  246. return cro;
  247. }
  248. /**
  249. * 人工引用界面 引用项目
  250. * @param parmas
  251. * @return
  252. */
  253. public CoreReturnObject getRgYitem(HashMap<String,String> parmas) {
  254. try{
  255. String sql ="select r.design_key,r.steel_code,to_char(r.THICK, 'fm990.099') thick,r.CERT_INST_NAME,r.batch_no,t.material_no,t.smp_type_name, "
  256. +" i.phy_name_l,i.phy_name_m,i.phy_name_s,i.item_name_d,i.item_name_t,i.item_name_s,i.item_desc_l,t.specimen_no,t.process_nos,t.Improve_Memo,"
  257. +" (select count(1) from qcm_jhy_sample_consign_d_item it where it.specimen_no = i.specimen_no and it.seq<=49) numb,t.SMP_LOCATION "
  258. +" from qcm_jhy_sample_consign_d t, "
  259. +" qcm_jhy_sample_r_ord r, "
  260. +" qcm_jhy_sample_consign_d_item i "
  261. +" where t.smp_no = r.smp_no "
  262. +" and t.specimen_no = i.specimen_no "
  263. +" and t.specimen_no = '"+parmas.get("SPECIMEN_NO")+"' and i.seq<=49 "
  264. +" order by i.seq ";
  265. List<HashMap> listEle= mapper.query(sql.toString());
  266. cro.setResult(listEle);
  267. UpdateInfo uinfo= new UpdateInfo();
  268. uinfo.doPhyItem(parmas.get("SPECIMEN_NO").toString());
  269. }catch(Exception ex){
  270. cro.setV_errCode(-1);
  271. cro.setV_errMsg("获取引用项目出错"+ex.getMessage());
  272. SqlSession.rollback();
  273. }
  274. SqlSession.close();
  275. return cro;
  276. }
  277. /**
  278. * 人工引用界面 被引用项目
  279. * @param parmas
  280. * @return
  281. */
  282. public CoreReturnObject getRgBYitem(HashMap<String,String> parmas) {
  283. try{
  284. String sqlStr=" and r.CERT_INST_CODE !='IC005' ";//美国船级社不能被引用
  285. if(parmas.get("B_DESIGN_KEY").toString()!=null && parmas.get("B_DESIGN_KEY").toString()!="" && !parmas.get("B_DESIGN_KEY").toString().equals("全部")){
  286. sqlStr += " and r.DESIGN_KEY='"+parmas.get("B_DESIGN_KEY").toString()+"' ";
  287. }
  288. if(parmas.get("B_STEEL_CODE").toString()!=null && parmas.get("B_STEEL_CODE").toString()!="" && !parmas.get("B_STEEL_CODE").toString().equals("全部")){
  289. sqlStr += " and r.steel_code='"+parmas.get("B_STEEL_CODE").toString()+"' ";
  290. }
  291. if(parmas.get("B_THICK").toString()!=null && parmas.get("B_THICK").toString()!="" && !parmas.get("B_THICK").toString().equals("全部")){
  292. sqlStr += " and to_char(r.THICK, 'fm990.099')=to_char("+parmas.get("B_THICK").toString()+", 'fm990.099') ";
  293. }
  294. String sqlD="select t.MATERIAL_NO,t.SPECIMEN_NO,t.FREQ_CODE,t.SMP_LOCATION_CODE from qcm_jhy_sample_consign_d t "
  295. + " where t.specimen_no = '"+parmas.get("SPECIMEN_NO")+"' ";
  296. List<HashMap> listD= mapper.query(sqlD.toString());
  297. if(listD !=null && listD.size()>=1){
  298. String FREQ_CODE = listD.get(0).get("FREQ_CODE").toString();
  299. String SMP_LOCATION_CODE = listD.get(0).get("SMP_LOCATION_CODE").toString();
  300. if(FREQ_CODE.equals("C") || FREQ_CODE.equals("H") || FREQ_CODE.equals("I")){
  301. String MATERIAL_NO = listD.get(0).get("MATERIAL_NO").toString();
  302. sqlStr +=" and t.MATERIAL_NO = '"+MATERIAL_NO+"' ";
  303. }
  304. if(SMP_LOCATION_CODE.equals("HA") || SMP_LOCATION_CODE.equals("HB")){
  305. sqlStr += " and t.SMP_LOCATION_CODE in ('HA','HB') ";
  306. }else{
  307. sqlStr += " and t.SMP_LOCATION_CODE = '"+SMP_LOCATION_CODE+"' ";
  308. }
  309. }
  310. String sql ="select r.design_key,i.seq,r.steel_code,to_char(r.THICK, 'fm990.099') THICK,r.batch_no,t.material_no,"
  311. + " case when i.Quote_Specimen_No is null then "
  312. +" t.smp_type_name "
  313. +" else "
  314. +" (select d.smp_type_name from qcm_jhy_sample_consign_d d where d.specimen_no = i.quote_specimen_no and rownum=1) "
  315. +" end smp_type_name, "
  316. +" i.phy_name_l,i.phy_name_m,i.Phy_Code_s,i.phy_name_s,i.item_name_d,i.item_name_t,i.item_name_s,i.item_desc_l,"
  317. +" t.specimen_no,t.process_nos,t.IMPROVE_MEMO,t.Smp_Location,r.Cert_Inst_Name,t.Freq_Name, "
  318. +" i.val1,i.val2,i.val3,i.avg_val,i.max_val,i.min_val,i.guid,p.phy_id,decode(p.is_pass,'0','合格','1','不合格') is_pass "
  319. +" from qcm_jhy_sample_consign_d t, "
  320. +" qcm_jhy_sample_r_ord r, "
  321. +" QCM_JHY_INSP_PHYSICS i, "
  322. +" QCM_JUDGE_PHYSICAL_RESULT p "
  323. +" where t.smp_no = r.smp_no "
  324. +" and t.specimen_no = i.specimen_no "
  325. +" and t.smp_no = p.smp_no "
  326. +" and t.specimen_no = p.specimen_no "
  327. +" and i.specimen_no = p.specimen_no "
  328. +" and i.guid = p.guid and r.phy_id = p.phy_id and i.create_name <>'现场默认' "
  329. +" and t.batch_no = '"+parmas.get("BATCH_NO")+"' "
  330. +" and r.JUDGE_STATUS <> '0' "
  331. //+" and r.Judge_Result_Code='1' "
  332. // +" AND p.SMP_NO not in ( "
  333. // +" select e.smp_no from QCM_JUDGE_PHYSICAL_RESULT e where e.batch_no = '"+parmas.get("BATCH_NO")+"' "
  334. // +" and e.PHY_CODE_S NOT IN ('J01','J02','J03','J04','J05','J06','J07','J08','J09') and e.is_pass = '1' group by e.smp_no "
  335. // +" ) "
  336. // +" and p.is_pass='0' "
  337. +" and t.status='3' "
  338. +" and t.Freq_Code <> 'D' "
  339. +" and to_number(to_char(r.THICK, 'fm990.099')) <= to_number(to_char('"+parmas.get("THICK")+"', 'fm990.099')) "
  340. +sqlStr
  341. +" group by r.design_key,i.seq,r.steel_code,r.thick,r.batch_no,t.material_no,t.smp_type_name, "
  342. +" i.phy_name_l,i.phy_name_m,i.Phy_Code_s,i.phy_name_s,i.item_name_d,i.item_name_t,i.item_name_s,i.item_desc_l,"
  343. +" t.specimen_no,t.process_nos,t.IMPROVE_MEMO,t.Smp_Location,r.Cert_Inst_Name,t.Freq_Name, "
  344. +" i.val1,i.val2,i.val3,i.avg_val,i.max_val,i.min_val,i.guid,p.phy_id,i.Quote_Specimen_No,p.is_pass "
  345. +" order by t.specimen_no,i.seq ";
  346. List<HashMap> listEle= mapper.query(sql.toString());
  347. if(listEle==null || listEle.size()<=0){
  348. sql= "";
  349. sql= "select * from (select r.design_key,i.seq,r.steel_code,to_char(r.THICK, 'fm990.099') THICK,r.batch_no,t.material_no, "
  350. +" case when i.Quote_Specimen_No is null then t.smp_type_name else "
  351. +" (select d.smp_type_name from qcm_jhy_sample_consign_d d where d.specimen_no = i.quote_specimen_no and rownum = 1) "
  352. +" end smp_type_name,i.phy_name_l,i.phy_name_m,i.Phy_Code_s,i.phy_name_s,i.item_name_d,i.item_name_t,i.item_name_s, "
  353. +" i.item_desc_l,t.specimen_no,t.process_nos,t.IMPROVE_MEMO,t.Smp_Location,r.Cert_Inst_Name,t.Freq_Name,i.val1, "
  354. +" i.val2,i.val3,i.avg_val,i.max_val,i.min_val,i.guid,p.phy_id,decode(p.is_pass, '0', '合格', '1', '不合格') is_pass "
  355. +" from qcm_jhy_sample_consign_d t,qcm_jhy_sample_r_ord r,QCM_JHY_INSP_PHYSICS i,QCM_JUDGE_PHYSICAL_RESULT p "
  356. +" where t.smp_no = r.smp_no and t.specimen_no = i.specimen_no and t.smp_no = p.smp_no and t.specimen_no = p.specimen_no "
  357. +" and i.specimen_no = p.specimen_no and i.guid = p.guid and r.phy_id = p.phy_id and i.create_name <>'现场默认' "
  358. +" and t.batch_no = '"+parmas.get("BATCH_NO")+"' "
  359. +" and r.JUDGE_STATUS <> '0' and t.status = '3' and t.Freq_Code <> 'D' "
  360. +" and to_number(to_char(r.THICK, 'fm990.099')) <= to_number(to_char('"+parmas.get("THICK")+"', 'fm990.099')) "
  361. +sqlStr
  362. +" UNION ALL "
  363. +" select r.design_key,i.seq,r.steel_code,to_char(r.THICK, 'fm990.099') THICK,r.batch_no,t.material_no, "
  364. +" case when i.Quote_Specimen_No is null then t.smp_type_name else "
  365. +" (select d.smp_type_name from qcm_jhy_sample_consign_d d where d.specimen_no = i.quote_specimen_no and rownum = 1) "
  366. +" end smp_type_name,i.phy_name_l,i.phy_name_m,i.Phy_Code_s,i.phy_name_s,i.item_name_d,i.item_name_t,i.item_name_s, "
  367. +" i.item_desc_l,t.specimen_no,t.process_nos,t.IMPROVE_MEMO,t.Smp_Location,r.Cert_Inst_Name,t.Freq_Name,i.val1, "
  368. +" i.val2,i.val3,i.avg_val,i.max_val,i.min_val,i.guid, '' phy_id,'未材质判定' is_pass "
  369. +" from qcm_jhy_sample_consign_d t,qcm_jhy_sample_r_ord r,QCM_JHY_INSP_PHYSICS i "
  370. +" where t.smp_no = r.smp_no and t.specimen_no = i.specimen_no and i.create_name <>'现场默认' "
  371. +" and t.batch_no = '"+parmas.get("BATCH_NO")+"' "
  372. +" and r.JUDGE_STATUS <> '0' and (r.Judge_Result_Code is null or r.JUDGE_RESULT_CODE='3') and t.status = '3' and t.Freq_Code <> 'D' "
  373. +" and to_number(to_char(r.THICK, 'fm990.099')) <= to_number(to_char('"+parmas.get("THICK")+"', 'fm990.099')) "
  374. +sqlStr
  375. +" ) t "
  376. +" group by t.design_key,t.seq,t.steel_code,t.thick,t.batch_no,t.material_no,t.smp_type_name,t.phy_name_l,t.phy_name_m, "
  377. +" t.Phy_Code_s,t.phy_name_s,t.item_name_d,t.item_name_t,t.item_name_s,t.item_desc_l,t.specimen_no,t.process_nos, "
  378. +" t.IMPROVE_MEMO,t.Smp_Location,t.Cert_Inst_Name,t.Freq_Name,t.val1,t.val2,t.val3,t.avg_val,t.max_val,t.min_val, "
  379. +" t.guid,t.phy_id,t.is_pass order by t.specimen_no, t.seq ";
  380. listEle= mapper.query(sql.toString());
  381. }
  382. cro.setResult(listEle);
  383. }catch(Exception ex){
  384. cro.setV_errCode(-1);
  385. cro.setV_errMsg("获取引用项目出错"+ex.getMessage());
  386. SqlSession.rollback();
  387. }
  388. SqlSession.close();
  389. return cro;
  390. }
  391. /**
  392. * 人工引用界面 订单号 牌号 规格
  393. * @param parmas
  394. * @return
  395. */
  396. public CoreReturnObject getQueryDesignKey(HashMap<String,String> parmas) {
  397. try{
  398. String sql ="select r.design_key,r.steel_code,to_char(r.THICK, 'fm990.099') thick from qcm_jhy_sample_r_ord r "
  399. +" where r.batch_no = '"+parmas.get("BATCH_NO")+"' "
  400. +" and to_number(to_char(r.thick,'fm990.099'))<=to_number(to_char('"+parmas.get("THICK")+"','fm990.099')) "
  401. +" group by r.design_key,r.steel_code,r.thick ";
  402. List<HashMap> listEle= mapper.query(sql.toString());
  403. cro.setResult(listEle);
  404. }catch(Exception ex){
  405. cro.setV_errCode(-1);
  406. cro.setV_errMsg("获取当前订单号出错"+ex.getMessage());
  407. SqlSession.rollback();
  408. }
  409. SqlSession.close();
  410. return cro;
  411. }
  412. /**
  413. * 人工引用界面 引用已选实绩
  414. * @param parmas
  415. * @return
  416. */
  417. public CoreReturnObject getBYITEM(String jsonArray,String specimenNo) {
  418. try{
  419. int quotenum = 0;//已引用数据
  420. int num1=0;
  421. String specimenNo2="";//被引用
  422. String username= "系统引用";
  423. String SEND_ID= "系统引用";
  424. TreeSet<String> trStr=new TreeSet<String>();
  425. if(specimenNo=="" || specimenNo==null){
  426. cro.setV_errCode(-1);
  427. cro.setV_errMsg("引用取样编号为空!!!");
  428. return cro;
  429. }
  430. JSONArray tarArr=JSON.parseArray(jsonArray);//被引用项目
  431. //引用基本数据
  432. String sql="select t.pline_code,t.batch_no,t.SMP_TYPE_CODE,t.MATERIAL_NO, "
  433. +" t.smp_no, "
  434. +" t.specimen_no,"
  435. +" i.seq, "
  436. +" r.design_key, "
  437. +" r.steel_code,r.CERT_INST_CODE, "
  438. +" to_char(r.THICK, 'fm990.099') THICK,"
  439. +" i.PHY_CODE_L, "
  440. +" i.phy_name_l, "
  441. +" i.PHY_CODE_M, "
  442. +" i.phy_name_m, "
  443. +" i.PHY_CODE_S, "
  444. +" i.phy_name_s, "
  445. +" i.ITEM_CODE_D, "
  446. +" i.item_name_d, "
  447. +" i.ITEM_CODE_T, "
  448. +" i.item_name_t, "
  449. +" i.ITEM_CODE_S, "
  450. +" i.item_name_s, "
  451. +" i.item_code_l, "
  452. +" i.item_desc_l "
  453. +" from qcm_jhy_sample_consign_d t, "
  454. +" qcm_jhy_sample_consign_m m, "
  455. +" qcm_jhy_sample_r_ord r, "
  456. +" qcm_jhy_sample_consign_d_item i "
  457. +" where t.smp_no = m.smp_no "
  458. +" and t.smp_no = r.smp_no "
  459. +" and m.smp_no = r.smp_no "
  460. +" and t.specimen_no = i.specimen_no "
  461. +" and t.freq_code <> 'D' "
  462. +" and i.seq <= 49 "
  463. +" and t.specimen_no = '"+specimenNo+"' ";
  464. List<HashMap> listItme= mapper.query(sql.toString());
  465. if(listItme==null || listItme.size()<=0){
  466. cro.setV_errCode(-1);
  467. cro.setV_errMsg("未找到引用项目!!!");
  468. return cro;
  469. }
  470. //判断规格
  471. String s_THICK = (String) listItme.get(0).get("THICK");//引用规格
  472. String s_CERT_INST_CODE = (String) listItme.get(0).get("CERT_INST_CODE");//引用认证机构
  473. String s_STEEL_CODE = (String) listItme.get(0).get("STEEL_CODE");//引用牌号
  474. String s_PHY_CODE_S = "0";
  475. //被引用规格
  476. for (int j = 0; j < tarArr.size(); j++) {
  477. JSONObject newTar=tarArr.getJSONObject(j);
  478. String s_THICK2 =newTar.getString("THICK").toString();
  479. if(!s_THICK.equals(s_THICK2)){
  480. SqlSession.rollback();
  481. SqlSession.close();
  482. cro.setV_errCode(-1);
  483. cro.setV_errMsg("引用失败!选择的【'"+newTar.getString("PHY_NAME_S")+"'】规格不一样!");
  484. return cro;
  485. }
  486. trStr.add(newTar.getString("SPECIMEN_NO").toString());//被引用取样编号
  487. //判断是否勾选了冲击
  488. if(newTar.getString("PHY_CODE_S").toString().equals("C01") || newTar.getString("PHY_CODE_S").toString().equals("C02")){
  489. s_PHY_CODE_S="1";
  490. }
  491. }
  492. //判断是否是挪威
  493. if(s_CERT_INST_CODE.equals("IC001") && s_PHY_CODE_S.equals("1")){
  494. String sqlcode=" select * from qcm_jhy_sample_consign_d_item i "
  495. +" where i.specimen_no = '"+specimenNo+"' and i.PHY_CODE_S = 'C01' and rownum = 1 ";
  496. List<HashMap> listcode= mapper.query(sqlcode.toString());
  497. if(listcode !=null && listcode.size()>=1){
  498. String ITEM_CODE_T = listcode.get(0).get("ITEM_CODE_T").toString();//温度
  499. for (String str : trStr) {//被引用取样编号
  500. String sqlcode2=" select * from qcm_jhy_sample_consign_d_item i "
  501. +" where i.specimen_no = '"+str+"' and i.PHY_CODE_S = 'C01' and rownum = 1 ";
  502. List<HashMap> listcode2= mapper.query(sqlcode2.toString());
  503. if(listcode2 !=null && listcode2.size()>=1){
  504. String ITEM_CODE_T2 = listcode2.get(0).get("ITEM_CODE_T").toString();//温度
  505. if(!ITEM_CODE_T.equals(ITEM_CODE_T2)){
  506. SqlSession.close();
  507. cro.setV_errCode(-1);
  508. cro.setV_errMsg("引用失败!技术中心规定挪威船级社冲击温度一样才可引用!请核实数据");
  509. return cro;
  510. }
  511. }
  512. }
  513. }
  514. }
  515. //船检限制
  516. if(s_CERT_INST_CODE.equals("IC002") || s_CERT_INST_CODE.equals("IC005") || s_CERT_INST_CODE.equals("IC006") ||
  517. s_CERT_INST_CODE.equals("IC007") || s_CERT_INST_CODE.equals("IC009") || s_CERT_INST_CODE.equals("IC008") ){
  518. for (String str : trStr) {//被引用取样编号
  519. String sqlr="select r.* from qcm_jhy_sample_consign_d d,qcm_jhy_sample_r_ord r where d.smp_no = r.smp_no and d.specimen_no = '"+str+"' and rownum = 1";
  520. List<HashMap> hmr= mapper.query(sqlr.toString());
  521. if(hmr!=null && hmr.size()>=1){
  522. String strCIC=hmr.get(0).get("CERT_INST_CODE").toString();
  523. String strSteelCode=hmr.get(0).get("STEEL_CODE").toString();
  524. if(strCIC.equals("5000")){
  525. SqlSession.rollback();
  526. SqlSession.close();
  527. cro.setV_errCode(-1);
  528. cro.setV_errMsg("引用失败!船检委托不能引用初样检测中心性能!请核实数据");
  529. return cro;
  530. }
  531. if(!s_STEEL_CODE.equals(strSteelCode)){
  532. SqlSession.rollback();
  533. SqlSession.close();
  534. cro.setV_errCode(-1);
  535. cro.setV_errMsg("引用失败!船检委托只能引用相同牌号性能!请核实数据");
  536. return cro;
  537. }
  538. }
  539. }
  540. }
  541. String hbB01 ="";//弯曲
  542. //引用项目循环
  543. for (int i = 0; i < listItme.size(); i++) {
  544. if("B01".equals((String) listItme.get(i).get("PHY_CODE_S"))){
  545. hbB01 ="0";
  546. }else{
  547. hbB01 ="";
  548. }
  549. //代码
  550. String phyCodeL = (String) listItme.get(i).get("PHY_CODE_L");//材质检验大项代码
  551. String phyCodeM = (String) listItme.get(i).get("PHY_CODE_M");//试样组代码
  552. String phyCodeS = (String) listItme.get(i).get("PHY_CODE_S");//材质检验项目代码
  553. String itemCodeD = (String) listItme.get(i).get("ITEM_CODE_D");//试验方向代码
  554. String itemCodeT = (String) listItme.get(i).get("ITEM_CODE_T");//试验温度代码 试验温度代码 冲击 被引用
  555. String itemCodeS = (String) listItme.get(i).get("ITEM_CODE_S");//试样尺寸代码
  556. String itemCodeL = (String) listItme.get(i).get("ITEM_CODE_L");//试验位置代码
  557. String newItem=phyCodeL+"-"+phyCodeM+"-"+phyCodeS;
  558. newItem=newItem+"-"+(itemCodeD!=null?itemCodeD:"null");
  559. newItem=newItem+"-"+(itemCodeT!=null?itemCodeT:"null");
  560. newItem=newItem+"-"+(itemCodeS!=null?itemCodeS:"null");
  561. //弯曲
  562. ///// String newItemHB=phyCodeL+"-"+phyCodeM+"-"+phyCodeS+"-"+(itemCodeD!=null?itemCodeD:"null")+"-"+(itemCodeT!=null?itemCodeT:"null");
  563. //被引用
  564. for (int j = 0; j < tarArr.size(); j++) {
  565. JSONObject newTar=tarArr.getJSONObject(j);
  566. username=newTar.getString("CREATE_NAME");
  567. SEND_ID=newTar.getString("SEND_ID");
  568. specimenNo2=newTar.getString("SPECIMEN_NO");
  569. String phyId= newTar.getString("PHY_ID");
  570. sql="";
  571. if(!StringUtils.isBlank(phyId)){
  572. sql="select to_char(r.THICK, 'fm990.099') THICK,t.specimen_no,t.PHY_CODE_L,t.PHY_CODE_M,t.PHY_CODE_S,t.ITEM_CODE_D,t.ITEM_CODE_T,t.ITEM_CODE_S,t.item_code_l,t.phy_name_s, "
  573. +" i.val1,i.val2,i.val3,i.avg_val,i.max_val,i.min_val,i.DEFECT_FLAG "
  574. +" from qcm_jhy_sample_consign_d d,qcm_jhy_sample_r_ord r,QCM_JHY_SAMPLE_CONSIGN_D_ITEM t, "
  575. +" QCM_JHY_INSP_PHYSICS i, "
  576. +" QCM_JUDGE_PHYSICAL_RESULT p "
  577. +" where d.smp_no=r.smp_no and d.specimen_no = t.specimen_no "
  578. + " and t.specimen_no = i.specimen_no and t.seq = i.seq "
  579. +" and t.specimen_no = p.specimen_no "
  580. +" and i.specimen_no = p.specimen_no "
  581. +" and i.guid = p.guid "
  582. +" and p.phy_id ='"+newTar.getString("PHY_ID")+"' "
  583. +" and t.specimen_no = '"+newTar.getString("SPECIMEN_NO")+"' "
  584. +" and t.PHY_CODE_S='"+newTar.getString("PHY_CODE_S")+"' "
  585. +" and i.guid='"+newTar.getString("GUID")+"' "
  586. +" and rownum=1 ";
  587. }else{
  588. sql="select to_char(r.THICK, 'fm990.099') THICK,t.specimen_no,t.PHY_CODE_L,t.PHY_CODE_M,t.PHY_CODE_S,t.ITEM_CODE_D,t.ITEM_CODE_T,t.ITEM_CODE_S,t.item_code_l,t.phy_name_s, "
  589. +" i.val1,i.val2,i.val3,i.avg_val,i.max_val,i.min_val,i.DEFECT_FLAG "
  590. +" from qcm_jhy_sample_consign_d d,qcm_jhy_sample_r_ord r,QCM_JHY_SAMPLE_CONSIGN_D_ITEM t, "
  591. +" QCM_JHY_INSP_PHYSICS i "
  592. +" where d.smp_no=r.smp_no and d.specimen_no = t.specimen_no "
  593. + " and t.specimen_no = i.specimen_no and t.seq = i.seq "
  594. +" and t.specimen_no = '"+newTar.getString("SPECIMEN_NO")+"' "
  595. +" and t.PHY_CODE_S='"+newTar.getString("PHY_CODE_S")+"' "
  596. +" and i.guid='"+newTar.getString("GUID")+"' "
  597. +" and rownum=1 ";
  598. }
  599. List<HashMap> qltyLists=mapper.query(sql.toString());
  600. if(qltyLists!=null && qltyLists.size()>=1){
  601. //代码
  602. String phyCodeL2 = (String) qltyLists.get(0).get("PHY_CODE_L");//材质检验大项代码
  603. String phyCodeM2 = (String) qltyLists.get(0).get("PHY_CODE_M");//试样组代码
  604. String phyCodeS2 = (String) qltyLists.get(0).get("PHY_CODE_S");//材质检验项目代码
  605. String itemCodeD2 = (String) qltyLists.get(0).get("ITEM_CODE_D");//试验方向代码
  606. String itemCodeT2 = (String) qltyLists.get(0).get("ITEM_CODE_T");//试验温度代码 试验温度代码 冲击 被引用
  607. String itemCodeS2 = (String) qltyLists.get(0).get("ITEM_CODE_S");//试样尺寸代码
  608. String itemCodeL2 = (String) qltyLists.get(0).get("ITEM_CODE_L");//试验位置代码
  609. String VAL1 = (String) qltyLists.get(0).get("VAL1");
  610. if(StringUtils.isBlank(VAL1)){VAL1="";}
  611. String VAL2 = (String) qltyLists.get(0).get("VAL2");
  612. if(StringUtils.isBlank(VAL2)){VAL2="";}
  613. String VAL3 = (String) qltyLists.get(0).get("VAL3");
  614. if(StringUtils.isBlank(VAL3)){VAL3="";}
  615. String AVG_VAL = (String) qltyLists.get(0).get("AVG_VAL");
  616. if(StringUtils.isBlank(AVG_VAL)){AVG_VAL="";}
  617. String DEFECT_FLAG = (String) qltyLists.get(0).get("DEFECT_FLAG");
  618. if(StringUtils.isBlank(DEFECT_FLAG)){DEFECT_FLAG="";}
  619. String MAX_VAL = (String) qltyLists.get(0).get("MAX_VAL");
  620. if(StringUtils.isBlank(MAX_VAL)){MAX_VAL="";}
  621. String MIN_VAL = (String) qltyLists.get(0).get("MIN_VAL");
  622. if(StringUtils.isBlank(MIN_VAL)){MIN_VAL="";}
  623. String newItem2=phyCodeL2+"-"+phyCodeM2+"-"+phyCodeS2;
  624. newItem2=newItem2+"-"+(itemCodeD2!=null?itemCodeD2:"null");
  625. newItem2=newItem2+"-"+(itemCodeT2!=null?itemCodeT2:"null");
  626. newItem2=newItem2+"-"+(itemCodeS2!=null?itemCodeS2:"null");
  627. //弯曲
  628. ///// String newItemHB2=phyCodeL2+"-"+phyCodeM2+"-"+phyCodeS2+"-"+(itemCodeD2!=null?itemCodeD2:"null")+"-"+(itemCodeT2!=null?itemCodeT2:"null");
  629. //判断是否是冲击试验
  630. if(phyCodeS.equals("C01") || phyCodeS.equals("C02")){
  631. if(phyCodeS.equals(phyCodeS2)){
  632. Integer co1t= Integer.parseInt(itemCodeT);//引用
  633. Integer co2t= Integer.parseInt(itemCodeT2);//被引用
  634. if(co1t >= co2t){
  635. //删除引用实绩
  636. sql = "";
  637. sql = "DELETE qcm_jhy_insp_physics t where t.SPECIMEN_NO= '"+listItme.get(i).get("SPECIMEN_NO")+"' "
  638. + " and t.PHY_CODE_S = '"+listItme.get(i).get("PHY_CODE_S")+"' "
  639. + " and t.seq = '"+listItme.get(i).get("SEQ")+"' "
  640. + " and t.seq<=49 ";
  641. mapper.delete(sql.toString());
  642. sql = "";
  643. sql = " insert into qcm_jhy_insp_physics "
  644. +" (specimen_no, seq, test_qty, phy_code_l, phy_name_l, phy_code_m, phy_name_m, phy_code_s, phy_name_s, item_code_d, item_name_d, item_code_t, item_name_t, item_code_s, item_name_s, "
  645. +" val1, val2, val3, avg_val, create_name, create_time, group_seq, defect_flag, max_val, min_val, item_code_l, item_desc_l, phy_unit) "
  646. +" select i.specimen_no,i.seq,i.test_qty,i.phy_code_l,i.phy_name_l,i.phy_code_m,i.phy_name_m, i.phy_code_s, i.phy_name_s, i.item_code_d, i.item_name_d, i.item_code_t, i.item_name_t, i.item_code_s, i.item_name_s, "
  647. +" '"+VAL1+"','"+VAL2+"','"+VAL3+"','"+AVG_VAL+"','"+newTar.getString("CREATE_NAME")+"',sysdate,i.group_seq,'"+DEFECT_FLAG+"','"+MAX_VAL+"','"+MIN_VAL+"',i.item_code_l,i.item_desc_l,i.phy_unit "
  648. +" from qcm_jhy_sample_consign_d_item i "
  649. +" where i.specimen_no = '"+listItme.get(i).get("SPECIMEN_NO")+"' "
  650. +" and i.phy_code_s = '"+listItme.get(i).get("PHY_CODE_S")+"' "
  651. +" and i.seq= '"+listItme.get(i).get("SEQ")+"' ";
  652. mapper.insert(sql);
  653. //修改ITEM表
  654. sql = "";
  655. sql =" update QCM_JHY_SAMPLE_CONSIGN_D_ITEM t set t.QUOTE_MEMO = '已引用"+newTar.getString("SPECIMEN_NO")+"' "
  656. + " where t.SPECIMEN_NO ='"+listItme.get(i).get("SPECIMEN_NO")+"' "
  657. + " and t.PHY_CODE_S = '"+listItme.get(i).get("PHY_CODE_S")+"' and t.seq = '"+listItme.get(i).get("SEQ")+"' ";
  658. mapper.updateJudgeStatus(sql.toString());
  659. quotenum++;
  660. break;
  661. }
  662. }
  663. }else{//其它试验
  664. //标准一样的引用
  665. if(newItem.equals(newItem2)){
  666. //删除引用实绩
  667. sql = "";
  668. sql = "DELETE qcm_jhy_insp_physics t where t.SPECIMEN_NO= '"+listItme.get(i).get("SPECIMEN_NO")+"' "
  669. + " and t.PHY_CODE_S = '"+listItme.get(i).get("PHY_CODE_S")+"' "
  670. + " and t.seq = '"+listItme.get(i).get("SEQ")+"' "
  671. + " and t.seq<=49 ";
  672. mapper.delete(sql.toString());
  673. sql = "";
  674. sql = " insert into qcm_jhy_insp_physics "
  675. +" (specimen_no, seq, test_qty, phy_code_l, phy_name_l, phy_code_m, phy_name_m, phy_code_s, phy_name_s, item_code_d, item_name_d, item_code_t, item_name_t, item_code_s, item_name_s, "
  676. +" val1, val2, val3, avg_val, create_name, create_time, group_seq, defect_flag, max_val, min_val, item_code_l, item_desc_l, phy_unit) "
  677. +" select i.specimen_no,i.seq,i.test_qty,i.phy_code_l,i.phy_name_l,i.phy_code_m,i.phy_name_m, i.phy_code_s, i.phy_name_s, i.item_code_d, i.item_name_d, i.item_code_t, i.item_name_t, i.item_code_s, i.item_name_s, "
  678. +" '"+VAL1+"','"+VAL2+"','"+VAL3+"','"+AVG_VAL+"','"+newTar.getString("CREATE_NAME")+"',sysdate,i.group_seq,'"+DEFECT_FLAG+"','"+MAX_VAL+"','"+MIN_VAL+"',i.item_code_l,i.item_desc_l,i.phy_unit "
  679. +" from qcm_jhy_sample_consign_d_item i "
  680. +" where i.specimen_no = '"+listItme.get(i).get("SPECIMEN_NO")+"' "
  681. +" and i.phy_code_s = '"+listItme.get(i).get("PHY_CODE_S")+"' "
  682. +" and i.seq= '"+listItme.get(i).get("SEQ")+"' ";
  683. mapper.insert(sql);
  684. //修改ITEM表
  685. sql = "";
  686. sql =" update QCM_JHY_SAMPLE_CONSIGN_D_ITEM t set t.QUOTE_MEMO = '已引用"+newTar.getString("SPECIMEN_NO")+"' "
  687. + " where t.SPECIMEN_NO ='"+listItme.get(i).get("SPECIMEN_NO")+"' "
  688. + " and t.PHY_CODE_S = '"+listItme.get(i).get("PHY_CODE_S")+"' and t.seq = '"+listItme.get(i).get("SEQ")+"' ";
  689. mapper.updateJudgeStatus(sql.toString());
  690. quotenum++;
  691. break;
  692. }
  693. }
  694. }
  695. }
  696. //申报:郭明清 主题:非计划船板改普板,冷弯需要系统默认合格 申报时间:2023-04-27 16:49:59
  697. //原牌号为船板 BV/IC003法国船级社,KR/IC004韩国船级社,DNV/IC001挪威船级社,CCS/IC010中国船级社 、ABS/IC005美国船级社、LR/IC009 英国船级社、NK/KA36/IC006 日本船级社、RINA/IC007 意大利船级社 、RS/IC002 俄罗斯 IC012 客户认证
  698. //改成普锰板(Q235A/B、Q345A/B、Q355B)
  699. //被引用是原牌号船板 引用是改判 普锰板
  700. //弯曲 默认合格
  701. if("B01".equals((String) listItme.get(i).get("PHY_CODE_S"))&& !"".equals(hbB01) && hbB01.equals("0") && !listItme.get(i).get("SPECIMEN_NO").toString().contains("YT1") ){
  702. sql="";
  703. sql="select d.* from qcm_jhy_sample_consign_d d,qcm_jhy_sample_r_ord r "
  704. +" where d.smp_no = r.smp_no and r.steel_code in ('Q235A','Q235B','Q345A','Q345B','Q355B') "
  705. +" and d.specimen_no = '"+specimenNo+"' ";
  706. List<HashMap> hashMap=mapper.query(sql.toString());
  707. if(hashMap!=null && hashMap.size()>=1){
  708. sql="";
  709. sql="select r.* from qcm_jhy_sample_consign_d d,qcm_jhy_sample_r_ord r "
  710. +" where d.smp_no = r.smp_no and r.cert_inst_code in ('IC005','IC009','IC006','IC007','IC002','IC003','IC004','IC001','IC010') "
  711. +" and d.specimen_no = '"+specimenNo2+"' ";
  712. List<HashMap> hashMap2=mapper.query(sql.toString());
  713. sql="";
  714. sql="select * from qcm_jhy_sample_consign_d_item where specimen_no = '"+specimenNo2+"' and phy_code_s='B01' ";
  715. List<HashMap> hashMap3=mapper.query(sql.toString());
  716. if(hashMap2!=null && hashMap2.size()>=1 && hashMap3.size()<=0 ){
  717. sql="";
  718. sql="insert into QCM_JHY_INSP_PHYSICS "
  719. +" (SPECIMEN_NO,SEQ,TEST_QTY,PHY_CODE_L,PHY_NAME_L,PHY_CODE_M,PHY_NAME_M,PHY_CODE_S,PHY_NAME_S,ITEM_CODE_D,ITEM_NAME_D, "
  720. +" ITEM_CODE_T,ITEM_NAME_T,ITEM_CODE_S,ITEM_NAME_S,VAL1,AVG_VAL,CREATE_NAME,CREATE_TIME,DEFECT_FLAG,MAX_VAL, "
  721. +" MIN_VAL,ITEM_CODE_L,ITEM_DESC_L,PHY_UNIT,MEMO) "
  722. +" select t.specimen_no,t.seq,t.test_qty,t.phy_code_l,t.phy_name_l,t.phy_code_m,t.phy_name_m,t.phy_code_s,t.phy_name_s,t.item_code_d,t.item_name_d, "
  723. +" t.item_code_t,t.item_name_t,t.item_code_s,t.item_name_s,'合格','合格','"+username+"',sysdate,'0','合格','合格',t.item_code_l,t.item_desc_l, "
  724. +" t.phy_unit,'默认合格' "
  725. +" from qcm_jhy_sample_consign_d_item t "
  726. +" where t.specimen_no = '"+specimenNo+"' "
  727. +" and t.phy_code_s = 'B01' ";
  728. mapper.insert(sql);
  729. //修改ITEM表
  730. sql = "";
  731. sql =" update QCM_JHY_SAMPLE_CONSIGN_D_ITEM t set t.QUOTE_MEMO = '默认合格' "
  732. + " where t.SPECIMEN_NO ='"+specimenNo+"' and t.phy_code_s = 'B01' ";
  733. mapper.updateJudgeStatus(sql.toString());
  734. quotenum++;
  735. }
  736. }
  737. }
  738. }
  739. //获取被引用的LIMS接收时间先放这
  740. sql="";
  741. sql="select * from qcm_jhy_insp_physics t where t.specimen_no = '"+specimenNo+"' and t.seq <= 49 ";
  742. List<HashMap> snoSQL= mapper.query(sql.toString());
  743. //被引用的项目 全部 已引用
  744. if((quotenum == listItme.size()) || (listItme.size() == snoSQL.size())){
  745. //修改D表
  746. sql = "";
  747. sql =" update QCM_JHY_SAMPLE_CONSIGN_D t set t.STATUS = '3',t.SEND_ID = '"+SEND_ID+"',"
  748. + " t.SEND_NAME = '"+username+"',t.SEND_TIME = sysdate,t.SEND_MEMO = '有引用',t.QUOTE_MEMO = '引用实绩' "
  749. + " where t.batch_no = '"+listItme.get(0).get("BATCH_NO")+"' "
  750. + " and SPECIMEN_NO ='"+listItme.get(0).get("SPECIMEN_NO")+"' ";
  751. mapper.updateJudgeStatus(sql.toString());
  752. if(listItme.get(0).get("SMP_TYPE_CODE").toString().equals("1")){
  753. //往log表中插入p
  754. sql = "";
  755. sql = " INSERT INTO QCM_JUDGE_LOG ( JUDGE_TYPE,MATERIAL_NO,CREATE_TIME,CREATE_NAME,PROD_LINE) "
  756. +" VALUES ( 'Q', '"+listItme.get(0).get("SMP_NO")+"', SYSDATE,'system','"+listItme.get(0).get("PLINE_CODE")+"')";
  757. mapper.insert(sql);
  758. }else{
  759. //往log表中插入p
  760. sql = "";
  761. sql = " INSERT INTO QCM_JUDGE_LOG ( JUDGE_TYPE,MATERIAL_NO,CREATE_TIME,CREATE_NAME,PROD_LINE) "
  762. +" VALUES ( 'P', '"+listItme.get(0).get("SMP_NO")+"', SYSDATE,'system','"+listItme.get(0).get("PLINE_CODE")+"')";
  763. mapper.insert(sql);
  764. }
  765. }else{
  766. //修改D表
  767. sql = "";
  768. sql =" update QCM_JHY_SAMPLE_CONSIGN_D t set t.SEND_MEMO = '有引用',t.QUOTE_MEMO = '引用实绩' "
  769. + " where t.batch_no = '"+listItme.get(0).get("BATCH_NO")+"' "
  770. + " and SPECIMEN_NO ='"+listItme.get(0).get("SPECIMEN_NO")+"' ";
  771. mapper.updateJudgeStatus(sql.toString());
  772. }
  773. //记录
  774. QcmJudgeOperateLog qjog = new QcmJudgeOperateLog();
  775. qjog.setOperate_name(username== null ?"":username);
  776. qjog.setBatchno(listItme.get(0).get("BATCH_NO") == null ?"":listItme.get(0).get("BATCH_NO").toString());
  777. qjog.setOperate_type("引用同批实绩");
  778. qjog.setParams(listItme.get(0).get("MATERIAL_NO") == null ?"":listItme.get(0).get("MATERIAL_NO").toString());
  779. qjog.setProd_line(listItme.get(0).get("PLINE_CODE") == null ?"":listItme.get(0).get("PLINE_CODE").toString());
  780. qjog.setMemo(specimenNo);
  781. mapper.insertQcmJudgeOperateLog(qjog);
  782. }catch(Exception e){
  783. SqlSession.rollback();
  784. SqlSession.close();
  785. cro.setV_errCode(-1);
  786. cro.setV_errMsg("引用失败!"+e.getMessage());
  787. return cro;
  788. }
  789. SqlSession.commit();
  790. SqlSession.close();
  791. cro.setV_errCode(1);
  792. cro.setV_errMsg("引用成功!");
  793. UpdateInfo uinfo= new UpdateInfo();
  794. try {
  795. uinfo.doPhyItem(specimenNo);
  796. } catch (Exception e) {
  797. // TODO Auto-generated catch block
  798. e.printStackTrace();
  799. }
  800. return cro;
  801. }
  802. /**
  803. * 订单标准错误 按订单删除委托
  804. * @param parmas
  805. * @return
  806. */
  807. public CoreReturnObject getConsignD(HashMap<String,String> parmas) {
  808. try{
  809. String sqlStr="";
  810. if(parmas.get("B_DK").toString()!=null && parmas.get("B_DK").toString()!="" && !parmas.get("B_DK").toString().equals("全部")){
  811. sqlStr += " and r.DESIGN_KEY like '"+parmas.get("B_DK").toString()+"%' ";
  812. }
  813. if(parmas.get("DESIGN_KEY").toString()!=null && parmas.get("DESIGN_KEY").toString()!="" && !parmas.get("DESIGN_KEY").toString().equals("全部")){
  814. sqlStr += " and r.DESIGN_KEY='"+parmas.get("DESIGN_KEY").toString()+"' ";
  815. }
  816. if(parmas.get("BATCH_NO").toString()!=null && parmas.get("BATCH_NO").toString()!="" && !parmas.get("BATCH_NO").toString().equals("全部")){
  817. sqlStr += " and t.BATCH_NO='"+parmas.get("BATCH_NO").toString()+"' ";
  818. }
  819. String sql ="select r.design_key,r.steel_code,r.thick,t.batch_no,t.heat_no,t.material_no,t.smp_no,t.specimen_no,t.quote_consign_no,t.inspection_lot, "
  820. +" t.freq_code,t.freq_name,t.pline_code,t.pline_name,t.smp_type_code,t.smp_type_name,t.SMP_LOCATION_CODE,t.smp_location,t.onememo,m.Smp_Catg,"
  821. +" m.Cert_Inst_Code,m.cert_inst_name,t.process_nos,t.Improve_Memo,t.status,r.Judge_Result_Code,r.Judge_Result_Desc "
  822. +" from qcm_jhy_sample_consign_d t,qcm_jhy_sample_consign_m m, qcm_jhy_sample_r_ord r "
  823. +" where t.smp_no = r.smp_no "
  824. +" and t.smp_no = m.smp_no "
  825. +" and m.smp_no = r.smp_no and t.status in ('0','1','2','3','7') "
  826. +sqlStr;
  827. List<HashMap> listEle= mapper.query(sql.toString());
  828. cro.setResult(listEle);
  829. }catch(Exception ex){
  830. cro.setV_errCode(-1);
  831. cro.setV_errMsg("获取当前订单号出错"+ex.getMessage());
  832. SqlSession.rollback();
  833. }
  834. SqlSession.close();
  835. return cro;
  836. }
  837. /**
  838. * 订单标准错误 按订单删除委托日志
  839. * @param parmas
  840. * @return
  841. */
  842. public CoreReturnObject getConsignDLog(HashMap<String,String> parmas) {
  843. try{
  844. String sqlStr="";
  845. if(parmas.get("B_DK").toString()!=null && parmas.get("B_DK").toString()!="" && !parmas.get("B_DK").toString().equals("全部")){
  846. sqlStr += " and t.JUDGE_RESULT like '"+parmas.get("B_DK").toString()+"%' ";
  847. }
  848. if(parmas.get("DESIGN_KEY").toString()!=null && parmas.get("DESIGN_KEY").toString()!="" && !parmas.get("DESIGN_KEY").toString().equals("全部")){
  849. sqlStr += " and t.JUDGE_RESULT='"+parmas.get("DESIGN_KEY").toString()+"' ";
  850. }
  851. if(parmas.get("BATCH_NO").toString()!=null && parmas.get("BATCH_NO").toString()!="" && !parmas.get("BATCH_NO").toString().equals("全部")){
  852. sqlStr += " and t.BATCHNO='"+parmas.get("BATCH_NO").toString()+"' ";
  853. }
  854. String sql =" select t.judge_result DESIGN_KEY,t.batchno,t.prod_line,t.params,t.operate_name, "
  855. +" to_char(t.operate_time,'YYYY-MM-DD hh24:mi:ss') operate_time,t.memo from qcm_judge_operate_log t"
  856. +" where t.operate_type = '一键删除委托' "
  857. +sqlStr;
  858. List<HashMap> listEle= mapper.query(sql.toString());
  859. cro.setResult(listEle);
  860. }catch(Exception ex){
  861. cro.setV_errCode(-1);
  862. cro.setV_errMsg("获取当前订单号出错"+ex.getMessage());
  863. SqlSession.rollback();
  864. }
  865. SqlSession.close();
  866. return cro;
  867. }
  868. /**
  869. * LIMS退回轧批查询
  870. * @param parmas
  871. * @return
  872. */
  873. public CoreReturnObject ZHBQueryLims(HashMap<String,String> parmas) {
  874. try{
  875. if (!SqlJoint.IsNullOrSpace(parmas.get("STARTTIME").toString()) && !SqlJoint.IsNullOrSpace(parmas.get("ENDTIME").toString())) {
  876. String sky=StrSky(parmas.get("STARTTIME").toString(),parmas.get("ENDTIME").toString());
  877. if(sky.equals("FALSE")){
  878. SqlSession.close();
  879. cro.setV_errCode(-1);
  880. cro.setV_errMsg("查询时间不能大于30天,请核实查询时间条件!");
  881. return cro;
  882. }
  883. }
  884. String sqlStr = " and t.PLINE_CODE like '"+parmas.get("PLINE_CODE").toString()+"%' ";
  885. if(StringUtils.isNotBlank(parmas.get("DESIGN_KEY").toString()) ){
  886. sqlStr += " and r.DESIGN_KEY='"+parmas.get("DESIGN_KEY").toString()+"' ";
  887. }
  888. if (parmas.get("BATCH_NO")!=null && !"".equals(((String)parmas.get("BATCH_NO")).trim())
  889. && parmas.get("BATCH_NO2")!=null && !"".equals(((String)parmas.get("BATCH_NO2")).trim()) ) {
  890. sqlStr +=" and upper(t.batch_no) >= upper('"+parmas.get("BATCH_NO")+"')";
  891. sqlStr +=" and upper(t.batch_no) <= upper('"+parmas.get("BATCH_NO2")+"')";
  892. }else if(parmas.get("BATCH_NO")!=null && !"".equals(((String)parmas.get("BATCH_NO")).trim())
  893. && parmas.get("checkboxVal").equals("1")){
  894. sqlStr +=" and t.batch_no like '"+parmas.get("BATCH_NO")+"%' ";
  895. }
  896. //退回时间
  897. if (parmas.get("STARTTIME")!=null && !"".equals(((String)parmas.get("STARTTIME")).trim())) {
  898. sqlStr +=" and t.RETURN_TIME>=to_date(concat('"+parmas.get("STARTTIME")+"',' 00:00:00'),'yyyy-MM-dd HH24:mi:ss')";
  899. }
  900. if (parmas.get("ENDTIME")!=null && !"".equals(((String)parmas.get("ENDTIME")).trim())) {
  901. sqlStr +=" and t.RETURN_TIME<=to_date(concat('"+parmas.get("ENDTIME")+"',' 23:59:59'),'yyyy-MM-dd HH24:mi:ss') ";
  902. }
  903. //YT1 有子板查询条件
  904. if("YT1".equals(parmas.get("PLINE_CODE").toString())){
  905. if (parmas.get("MATERIAL_NO")!=null && !"".equals(((String)parmas.get("MATERIAL_NO")).trim())) {
  906. sqlStr += " and t.material_no LIKE '"+parmas.get("MATERIAL_NO").toString()+"%' ";
  907. }
  908. }
  909. String sql ="select r.design_key,r.steel_code,r.thick,t.batch_no,t.heat_no,t.material_no,t.smp_no,t.specimen_no,t.quote_consign_no,t.inspection_lot, "
  910. +" t.freq_code,t.freq_name,t.pline_code,t.pline_name,t.smp_type_code,t.smp_type_name,t.SMP_LOCATION_CODE,t.smp_location,t.onememo,m.Smp_Catg,"
  911. +" m.Cert_Inst_Code,m.cert_inst_name,t.process_nos,t.Improve_Memo,t.status,r.Judge_Result_Code,r.Judge_Result_Desc,to_char(t.Collect_Time,'yyyy-MM-dd hh24:mi:ss') COLLECT_TIME,"
  912. +" to_char(t.RETURN_TIME,'yyyy-MM-dd hh24:mi:ss') RETURN_TIME,T.RETURN_MEMO,T.RETURN_NAME "
  913. +" from qcm_jhy_sample_consign_d t,qcm_jhy_sample_consign_m m, qcm_jhy_sample_r_ord r "
  914. +" where t.smp_no = r.smp_no and t.smp_no = m.smp_no and m.smp_no = r.smp_no "
  915. +" and T.RETURN_NAME IS NOT NULL and t.status not in ('4','5','6') "
  916. +sqlStr;
  917. List<HashMap> listEle= mapper.query(sql.toString());
  918. cro.setResult(listEle);
  919. }catch(Exception ex){
  920. cro.setV_errCode(-1);
  921. cro.setV_errMsg("获取委托出错"+ex.getMessage());
  922. SqlSession.rollback();
  923. }
  924. SqlSession.close();
  925. return cro;
  926. }
  927. //查询中厚板LRA
  928. public CoreReturnObject getZHBLRA(HashMap<String,String> parmas) {
  929. try{
  930. String sqlStr="";
  931. if(parmas.get("STARTTIME").toString()!=null && !"".equals(((String)parmas.get("STARTTIME")).trim())
  932. && parmas.get("ENDTIME").toString()!=null && !"".equals(((String)parmas.get("ENDTIME")).trim()) ){
  933. sqlStr +=" and t.CREATE_TIME>=to_date('"+parmas.get("STARTTIME")+" 00:00:00','yyyy-MM-dd HH24:mi:ss')";
  934. sqlStr +=" and t.CREATE_TIME<=to_date('"+parmas.get("ENDTIME")+" 23:59:59','yyyy-MM-dd HH24:mi:ss') ";
  935. }
  936. if(parmas.get("BATCH_NO").toString()!=null && !"".equals(((String)parmas.get("BATCH_NO")).trim()) ){
  937. sqlStr += " and t.BATCH_NO='"+parmas.get("BATCH_NO").toString()+"' ";
  938. }
  939. if(parmas.get("SPECIMEN_NO").toString()!=null && !"".equals(((String)parmas.get("SPECIMEN_NO")).trim()) ){
  940. sqlStr += " and t.SPECIMEN_NO='"+parmas.get("SPECIMEN_NO").toString()+"' ";
  941. }
  942. String sql =" select r.design_key,r.steel_code,r.thick,t.batch_no,t.material_no,t.smp_no,t.specimen_no,t.freq_name, "
  943. +" t.smp_type_name,t.smp_location,t.pline_code,t.pline_name,t.status,r.cert_inst_name,to_char(t.create_time,'YYYY-MM-dd hh24:mi:ss') create_time "
  944. +" from qcm_jhy_sample_consign_d t,qcm_jhy_sample_consign_m m,qcm_jhy_sample_r_ord r "
  945. +" where t.smp_no = m.smp_no and t.smp_no = r.smp_no and m.smp_no = r.smp_no "
  946. +" and m.Smp_Catg='B' and r.steel_code like 'LRA%' and t.Special_Quote_Memo is not null "
  947. +" and t.pline_code in ('HB1','ZB1') and t.status = '0' and t.Smp_Type_Code = '0' "
  948. + sqlStr
  949. +" order by t.create_time desc ";
  950. List<HashMap> listEle= mapper.query(sql.toString());
  951. cro.setResult(listEle);
  952. }catch(Exception ex){
  953. cro.setV_errCode(-1);
  954. cro.setV_errMsg("获取出错"+ex.getMessage());
  955. SqlSession.rollback();
  956. }
  957. SqlSession.close();
  958. return cro;
  959. }
  960. //查询中厚板LRA引用
  961. public CoreReturnObject getZHBLRAITEM(HashMap<String,String> parmas) {
  962. try{
  963. String sql =" select r.design_key,r.steel_code,r.thick,t.batch_no,t.material_no,t.smp_no,t.specimen_no,t.freq_name, "
  964. +" t.smp_type_name,t.smp_location,t.pline_code,t.pline_name,t.status,r.cert_inst_name,to_char(t.create_time,'YYYY-MM-dd hh24:mi:ss') create_time "
  965. +" from qcm_jhy_sample_consign_d t,qcm_jhy_sample_consign_m m,qcm_jhy_sample_r_ord r,qcm_jhy_sample_consign_d_item i "
  966. +" where t.smp_no = m.smp_no and t.smp_no = r.smp_no and m.smp_no = r.smp_no and t.specimen_no = i.specimen_no "
  967. +" and t.smp_no = i.smp_no and m.smp_no = i.smp_no and r.smp_no = i.smp_no "
  968. +" and m.Smp_Catg='B' and r.steel_code like 'LRA%' and t.pline_code in ('HB1','ZB1') and t.Smp_Type_Code = '0' "
  969. +" and i.quote_specimen_no = '"+parmas.get("SPECIMEN_NO").toString()+"' "
  970. +" group by r.design_key,r.steel_code,r.thick,t.batch_no,t.material_no,t.smp_no,t.specimen_no,t.freq_name, "
  971. +" t.smp_type_name,t.smp_location,t.pline_code,t.pline_name,t.status,r.cert_inst_name,t.create_time "
  972. +" order by t.status asc ";
  973. List<HashMap> listEle= mapper.query(sql.toString());
  974. cro.setResult(listEle);
  975. }catch(Exception ex){
  976. cro.setV_errCode(-1);
  977. cro.setV_errMsg("获取出错"+ex.getMessage());
  978. SqlSession.rollback();
  979. }
  980. SqlSession.close();
  981. return cro;
  982. }
  983. //查询中厚板是否有合并
  984. public CoreReturnObject Sel_ZHB_HB(String Entrust) {
  985. try{
  986. String[] ja=Entrust.split(",");
  987. String msInfo="";
  988. if (ja!=null && ja.length>0) {
  989. for (int i = 0; i < ja.length; i++) {
  990. String sp = ja[i];
  991. if ("".equals(msInfo)) {
  992. msInfo="'"+sp+"'";
  993. }else{
  994. msInfo=msInfo+"'"+sp+"'";
  995. }
  996. if (i !=ja.length-1) {
  997. msInfo=msInfo+",";
  998. }
  999. }
  1000. }
  1001. //主题:关于DNV性能引用 技术中心李娇丽提出 申报时间2024-10-28 11:06:27
  1002. //2024年挪威船级社年审提出,低等级不能引用高等级性能,因为低等级的冲击未进行试验,没有试验原始记录,挪威船级社DNV需要在冲击温度相同的情况下才能引用性能。
  1003. //241028修改 ,'IC001' 去掉
  1004. String sql =" select d.specimen_no,r.* from qcm_jhy_sample_consign_d d,qcm_jhy_sample_consign_m m,qcm_jhy_sample_r_ord r "
  1005. +" where d.smp_no = m.smp_no and d.smp_no = r.smp_no and m.smp_no = r.smp_no "
  1006. +" and r.design_key not like '19%' "
  1007. +" and d.freq_code = 'A' "
  1008. +" and d.smp_type_code = '0' "
  1009. +" and d.status = '0' and d.IMPROVE_MEMO is null "
  1010. +" and r.std_code not like '%ASTM%' "
  1011. +" and r.std_code not like '%ASME%' "
  1012. +" and r.Cert_Inst_Code in ('5000','IC010','IC003','IC004') "
  1013. +" and m.SMP_CATG = 'B' "
  1014. +" and d.specimen_no in ("+msInfo+") "
  1015. +" and d.specimen_no not in ( select i.specimen_no from qcm_jhy_sample_consign_d_item i "
  1016. +" where i.specimen_no in ("+msInfo+") and i.phy_code_l = 'HC' and to_number(REGEXP_REPLACE(i.item_code_t,'[^-0-9]','')) <= -40 ) ";
  1017. List<HashMap> listEle= mapper.query(sql.toString());
  1018. if(listEle!=null && listEle.size()>=1){
  1019. for (HashMap hashMap : listEle) {
  1020. String BATCH_NO = (String) hashMap.get("BATCH_NO");
  1021. String mnhhsql="select * from qcm_jhy_sample_consign_d t where t.Smp_Location like '%模拟焊后%' and t.batch_no = '"+BATCH_NO+"' ";//判断是否是模拟焊后轧批
  1022. List<HashMap> listm= mapper.query(mnhhsql.toString());
  1023. if(listm!=null && listm.size()>=1){
  1024. continue;
  1025. }
  1026. String DELIVERY_STATE_DESC = (String) hashMap.get("DELIVERY_STATE_DESC");
  1027. String THICK = (String) hashMap.get("THICK");
  1028. sql=" select * from ( select d.specimen_no,r.design_key,r.steel_code,r.thick,r.batch_no, "
  1029. +" QCM_SPECFLAG(r.STEEL_CODE, r.THICK, r.std_code, r.CERT_INST_NAME) qcmSpecflag "
  1030. +" from qcm_jhy_sample_consign_d d,qcm_jhy_sample_consign_m m,qcm_jhy_sample_r_ord r "
  1031. +" where d.smp_no = m.smp_no and d.smp_no = r.smp_no and m.smp_no = r.smp_no "
  1032. +" and r.design_key not like '19%' "
  1033. +" and d.freq_code = 'A' "
  1034. +" and d.smp_type_code = '0' "
  1035. +" and d.status = '0' and d.IMPROVE_MEMO is null "
  1036. +" and r.std_code not like '%ASTM%' "
  1037. +" and r.std_code not like '%ASME%' "
  1038. +" and r.Cert_Inst_Code in ('5000','IC010','IC003','IC004') "
  1039. +" and m.SMP_CATG = 'B' "
  1040. +" and r.Delivery_State_Desc='"+DELIVERY_STATE_DESC+"' "
  1041. +" and r.thick='"+THICK+"' "
  1042. +" and d.batch_no ='"+BATCH_NO+"' "
  1043. +" and d.specimen_no not in ( select i.specimen_no from qcm_jhy_sample_consign_d t,qcm_jhy_sample_consign_d_item i "
  1044. +" where t.specimen_no = i.specimen_no and t.batch_no = '"+BATCH_NO+"' and t.specimen_no in ("+msInfo+") and i.phy_code_l = 'HC' "
  1045. +" and to_number(REGEXP_REPLACE(i.item_code_t,'[^-0-9]','')) <= -40 ) "
  1046. +" )t where t.qcmSpecflag in ('1','0') ";
  1047. List<HashMap> listBatchNo= mapper.query(sql.toString());
  1048. if(listBatchNo!=null && listBatchNo.size()>=2){
  1049. cro.setV_errCode(-1);
  1050. cro.setV_errMsg("轧批:"+BATCH_NO+",有多牌号或同牌号多委托其中有可以合并的[请选择同批合并发送]");
  1051. return cro;
  1052. }else{
  1053. sql="";
  1054. sql="select * from (select d.specimen_no,r.design_key,r.steel_code,r.thick,r.batch_no, "
  1055. +" QCM_SPECFLAG(r.STEEL_CODE, r.THICK, r.std_code, r.CERT_INST_NAME) qcmSpecflag "
  1056. +" from qcm_jhy_sample_consign_d d,qcm_jhy_sample_consign_m m,qcm_jhy_sample_r_ord r "
  1057. +" where d.smp_no = m.smp_no and d.smp_no = r.smp_no and m.smp_no = r.smp_no "
  1058. +" and r.design_key not like '19%' "
  1059. +" and d.freq_code = 'A' "
  1060. +" and d.smp_type_code = '0' "
  1061. +" and d.status = '0' and d.IMPROVE_MEMO is null "
  1062. +" and r.std_code not like '%ASTM%' "
  1063. +" and r.std_code not like '%ASME%' "
  1064. +" and r.Cert_Inst_Code in ('5000','IC010','IC003','IC004') "
  1065. +" and m.SMP_CATG = 'B' "
  1066. +" and r.Delivery_State_Desc in ('TMCP','AR','CR') "
  1067. +" and r.thick='"+THICK+"' "
  1068. +" and (r.STD_CODE like '%Rules' OR r.steel_code in ('Q235A','Q235B','Q345A','Q345B','Q355B')) "
  1069. +" and d.batch_no ='"+BATCH_NO+"' "
  1070. +" and d.specimen_no not in ( select i.specimen_no from qcm_jhy_sample_consign_d t,qcm_jhy_sample_consign_d_item i "
  1071. +" where t.specimen_no = i.specimen_no and t.batch_no = '"+BATCH_NO+"' and t.specimen_no in ("+msInfo+") and i.phy_code_l = 'HC' "
  1072. +" and to_number(REGEXP_REPLACE(i.item_code_t,'[^-0-9]','')) <= -40 ) "
  1073. +" )t where t.qcmSpecflag in ('1','0') ";
  1074. List<HashMap> listBatchNo2= mapper.query(sql.toString());
  1075. if(listBatchNo2!=null && listBatchNo2.size()>=2){
  1076. cro.setV_errCode(-1);
  1077. cro.setV_errMsg("轧批:"+BATCH_NO+",有多牌号或同牌号多委托其中有可以合并的[请选择同批合并发送]");
  1078. return cro;
  1079. }
  1080. }
  1081. }
  1082. }
  1083. }catch(Exception ex){
  1084. cro.setV_errCode(-1);
  1085. cro.setV_errMsg("获取出错"+ex.getMessage());
  1086. SqlSession.rollback();
  1087. }
  1088. cro.setV_errCode(0);
  1089. SqlSession.close();
  1090. return cro;
  1091. }
  1092. //船检编号
  1093. public CoreReturnObject getHZBNumber(HashMap<String,String> parmas) {
  1094. try{
  1095. if (!SqlJoint.IsNullOrSpace(parmas.get("SEND_TIME1").toString()) && !SqlJoint.IsNullOrSpace(parmas.get("SEND_TIME2").toString())) {
  1096. String sky=StrSky(parmas.get("SEND_TIME1").toString(),parmas.get("SEND_TIME2").toString());
  1097. if(sky.equals("FALSE")){
  1098. SqlSession.close();
  1099. cro.setV_errCode(-1);
  1100. cro.setV_errMsg("查询时间不能大于30天,请核实查询时间条件!");
  1101. return cro;
  1102. }
  1103. }
  1104. String sqlStr="";
  1105. if(!StringUtils.isBlank(parmas.get("SEND_TIME1")) && !StringUtils.isBlank(parmas.get("SEND_TIME2"))){
  1106. sqlStr +=" and d.SEND_TIME>=to_date('"+parmas.get("SEND_TIME1")+" 00:00:00','yyyy-MM-dd HH24:mi:ss')";
  1107. sqlStr +=" and d.SEND_TIME<=to_date('"+parmas.get("SEND_TIME2")+" 23:59:59','yyyy-MM-dd HH24:mi:ss') ";
  1108. }
  1109. if(!StringUtils.isBlank(parmas.get("SAMPLE_DELIVERY_TIME"))){
  1110. sqlStr += " and d.SAMPLE_DELIVERY_TIME='"+parmas.get("SAMPLE_DELIVERY_TIME").toString()+"' ";
  1111. }
  1112. if(!StringUtils.isBlank(parmas.get("CERT_INST_CODE"))){
  1113. sqlStr += " and m.CERT_INST_CODE='"+parmas.get("CERT_INST_CODE").toString()+"' ";
  1114. }
  1115. if(!StringUtils.isBlank(parmas.get("SMP_CATG_CODE"))){
  1116. sqlStr += " and m.SMP_CATG='"+parmas.get("SMP_CATG_CODE").toString()+"' ";
  1117. }
  1118. if(!StringUtils.isBlank(parmas.get("BATCH_NO1")) && !StringUtils.isBlank(parmas.get("BATCH_NO2"))){
  1119. sqlStr +=" and upper(d.batch_no) >= upper('"+parmas.get("BATCH_NO1")+"') ";
  1120. sqlStr +=" and upper(d.batch_no) <= upper('"+parmas.get("BATCH_NO2")+"') ";
  1121. }else if(!StringUtils.isBlank(parmas.get("BATCH_NO1"))){
  1122. sqlStr +=" and upper(d.batch_no) = '"+parmas.get("BATCH_NO1")+"' ";
  1123. }
  1124. if(!StringUtils.isBlank(parmas.get("PLINE_CODE"))){
  1125. sqlStr += " and d.PLINE_CODE='"+parmas.get("PLINE_CODE").toString()+"' ";
  1126. }else{
  1127. sqlStr += " and d.PLINE_CODE in ('ZB1','HB1') ";
  1128. }
  1129. String sql =" select d.SAMPLE_DELIVERY_TIME, d.SEND_SEQ, "
  1130. +" d.PRINT_SEQ, "
  1131. +" d.PRINT_SEQJ, "
  1132. +" d.HEAT_NO, "
  1133. +" d.BATCH_NO, "
  1134. +" d.MATERIAL_NO, "
  1135. +" d.PLINE_CODE_LIMS, "
  1136. +" r.STEEL_CODE, "
  1137. +" m.CERT_INST_CODE, "
  1138. +" m.CERT_INST_NAME, "
  1139. +" d.SMP_TYPE_CODE, "
  1140. +" case "
  1141. +" when d.SMP_TYPE_CODE = '0' then "
  1142. +" case "
  1143. +" when m.CERT_INST_CODE in "
  1144. +" ('IC003', 'IC004', 'IC001', 'IC010', '5000') then "
  1145. +" d.SMP_TYPE_NAME "
  1146. +" else "
  1147. +" '认证样' "
  1148. +" end "
  1149. +" else "
  1150. +" d.SMP_TYPE_NAME "
  1151. +" end SMP_TYPE_NAME, "
  1152. +" d.STATUS, "
  1153. +" d.FREQ_CODE, "
  1154. +" d.FREQ_NAME, "
  1155. +" m.SMP_CATG, "
  1156. +" d.SMP_NO, "
  1157. +" d.SPECIMEN_NO, "
  1158. +" d.INSPECTION_LOT, "
  1159. +" r.DESIGN_KEY, "
  1160. +" to_char(r.THICK, 'fm990.099') THICK, "
  1161. +" d.PROCESS_NOS, "
  1162. +" d.SMP_LOCATION, "
  1163. +" d.PLINE_CODE, "
  1164. +" d.PLINE_NAME, "
  1165. +" d.BOARD_NO, "
  1166. +" r.DELIVERY_STATE_DESC, "
  1167. +" r.PROD_NAME, "
  1168. +" r.STD_NAME, "
  1169. +" to_char(d.COLLECT_TIME, 'yyyy-mm-dd hh24:mi:ss') COLLECT_TIME, "
  1170. +" d.ZHB_SPECIMEN_NO, "
  1171. +" d.QUOTE_CONSIGN_NO, "
  1172. +" d.SEND_NAME, "
  1173. +" to_char(d.SEND_TIME, 'yyyy-mm-dd hh24:mi:ss') SEND_TIME, "
  1174. +" to_char(d.CREATE_TIME, 'yyyy-mm-dd hh24:mi:ss') CREATE_TIME "
  1175. +" from qcm_jhy_sample_consign_d d, "
  1176. +" qcm_jhy_sample_consign_m m, "
  1177. +" qcm_jhy_sample_r_ord r "
  1178. +" where d.smp_no = m.smp_no "
  1179. +" and d.smp_no = r.smp_no "
  1180. +" and m.smp_no = r.smp_no "
  1181. +" and d.status in ('2', '3', '7') "
  1182. +" and d.Quote_Consign_No is null "
  1183. //+" and nvl(d.Send_Memo, 'null') <> '有引用' "
  1184. +" and d.send_name not in ('QMS', 'sys', 'system', '引用', '引用发送', '系统自动') "
  1185. +" and d.SAMPLE_DELIVERY_TIME is not null and d.PLINE_CODE_LIMS is not null "
  1186. + sqlStr
  1187. +" order by d.SAMPLE_DELIVERY_TIME asc, r.steel_code asc,d.MATERIAL_NO asc ";
  1188. List<HashMap> listEle= mapper.query(sql.toString());
  1189. cro.setResult(listEle);
  1190. }catch(Exception ex){
  1191. cro.setV_errCode(-1);
  1192. cro.setV_errMsg("获取出错"+ex.getMessage());
  1193. SqlSession.rollback();
  1194. }
  1195. SqlSession.close();
  1196. return cro;
  1197. }
  1198. //重置船检编号查询
  1199. public CoreReturnObject getHZBNumberQ(HashMap<String,String> parmas) {
  1200. try{
  1201. String sqlStr="";
  1202. /*if(!StringUtils.isBlank(parmas.get("SEND_TIME1")) && !StringUtils.isBlank(parmas.get("SEND_TIME2"))){
  1203. sqlStr +=" and t.CREATE_TIME>=to_date('"+parmas.get("SEND_TIME1")+" 00:00:00','yyyy-MM-dd HH24:mi:ss')";
  1204. sqlStr +=" and t.CREATE_TIME<=to_date('"+parmas.get("SEND_TIME2")+" 23:59:59','yyyy-MM-dd HH24:mi:ss') ";
  1205. }*/
  1206. if(!StringUtils.isBlank(parmas.get("CERT_INST_CODE"))){
  1207. sqlStr += " and t.CERT_INST_CODE='"+parmas.get("CERT_INST_CODE").toString()+"' ";
  1208. }
  1209. if(parmas.get("YN").equals("1")){
  1210. sqlStr += " and t.YN_LOG='"+parmas.get("YN").toString()+"' ";
  1211. }
  1212. String sql ="select T.YN_LOG, "
  1213. +" T.FH_LOG, "
  1214. +" T.CERT_INST_CODE, "
  1215. +" T.CERT_INST_NAME, "
  1216. +" T.YYMM, "
  1217. +" to_char(T.CREATE_TIME, 'yyyy-mm-dd hh24:mi:ss') CREATE_TIME, "
  1218. +" T.CREATE_NAME, "
  1219. +" (SELECT NVL(MAX(d.PRINT_SEQJ),0) PRINT_SEQJ "
  1220. +" FROM QCM_JHY_SAMPLE_CONSIGN_D d "
  1221. +" WHERE d.PRINT_SEQJ like T.FH_LOG || '%' "
  1222. +" AND d.PRINT_SEQJ IS NOT NULL "
  1223. +" AND d.PRINT_SEQJLOT IS NULL) PRINT_SEQJ "
  1224. +" from QCM_JHY_SHIP_INSPEC t "
  1225. +" where 1 = 1 "
  1226. + sqlStr
  1227. +" order by T.YN_LOG desc ";
  1228. List<HashMap> listEle= mapper.query(sql.toString());
  1229. cro.setResult(listEle);
  1230. }catch(Exception ex){
  1231. cro.setV_errCode(-1);
  1232. cro.setV_errMsg("获取出错"+ex.getMessage());
  1233. SqlSession.rollback();
  1234. }
  1235. SqlSession.close();
  1236. return cro;
  1237. }
  1238. //螺纹钢牌号
  1239. public CoreReturnObject getLWGSTEEL(HashMap<String,String> parmas) {
  1240. try{
  1241. String sql =" select rownum as RNUM,t.YN_LOG, "
  1242. +" t.STEEL_NAME, "
  1243. +" t.CREATE_NAME, "
  1244. +" to_char(t.CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') CREATE_TIME, "
  1245. +" t.DELETE_NAME, "
  1246. +" to_char(t.DELETE_TIME,'yyyy-mm-dd hh24:mi:ss') DELETE_TIME "
  1247. +" from QCM_JHY_STEEL t "
  1248. +" where t.regulation = '1' ";
  1249. List<HashMap> listEle= mapper.query(sql.toString());
  1250. cro.setResult(listEle);
  1251. }catch(Exception ex){
  1252. cro.setV_errCode(-1);
  1253. cro.setV_errMsg("获取出错"+ex.getMessage());
  1254. SqlSession.rollback();
  1255. }
  1256. SqlSession.close();
  1257. return cro;
  1258. }
  1259. //自动查询螺纹钢牌号
  1260. public CoreReturnObject getBZSTEEL(HashMap<String,String> parmas) {
  1261. try{
  1262. String sql ="select STEEL_CODE,STEEL_NAME from QCM_ORD_DESIGN_STD_PIC_SMP t"
  1263. + " where t.process_code in ('BC2','GX1','GX2','BC1')"
  1264. + " and t.prod_code in ('040','041') group by STEEL_CODE,STEEL_NAME order by STEEL_CODE ";
  1265. List<HashMap> listEle= mapper.query(sql.toString());
  1266. cro.setResult(listEle);
  1267. }catch(Exception ex){
  1268. cro.setV_errCode(-1);
  1269. cro.setV_errMsg("获取出错"+ex.getMessage());
  1270. SqlSession.rollback();
  1271. }
  1272. SqlSession.close();
  1273. return cro;
  1274. }
  1275. /**
  1276. * 中厚板合并委托 挪威船级社限制 冲击温度一样才可以合并引用
  1277. * 主题:关于DNV性能引用 技术中心李娇丽提出 申报时间2024-10-28 11:06:27
  1278. * 2024年挪威船级社年审提出,低等级不能引用高等级性能,因为低等级的冲击未进行试验,没有试验原始记录,挪威船级社DNV需要在冲击温度相同的情况下才能引用性能。
  1279. * @param parmas
  1280. * @return
  1281. */
  1282. public CoreReturnObject getZHBDNV(HashMap<String,String> parmas) {
  1283. try{
  1284. String BATCH_NO=parmas.get("BATCH_NO").toString();
  1285. //查询当前轧批号下是否有挪威 挪威下面是否有冲击项目
  1286. String sql =" select d.batch_no,r.cert_inst_name,r.DELIVERY_STATE_DESC,r.thick,i.* "
  1287. +" from qcm_jhy_sample_consign_d d,qcm_jhy_sample_r_ord r,qcm_jhy_sample_consign_d_item i "
  1288. +" where d.smp_no = r.smp_no and d.specimen_no = i.specimen_no and r.smp_no = i.smp_no and r.Cert_Inst_Code = 'IC001' "
  1289. +" and i.PHY_CODE_L = 'HC' and d.status = '0' and d.batch_no = '"+BATCH_NO+"' ";
  1290. List<HashMap> listEle= mapper.query(sql.toString());
  1291. if(listEle!=null && listEle.size()>=1){
  1292. String SPECIMEN_NO = listEle.get(0).get("SPECIMEN_NO").toString();
  1293. String THICK = listEle.get(0).get("THICK").toString();
  1294. String sql1=" select * from (select t.*,QCM_SPECFLAG(r.STEEL_CODE,r.THICK,r.std_code,m.CERT_INST_NAME) qcmSpecflag "
  1295. +" from qcm_jhy_sample_consign_d t,qcm_jhy_sample_consign_m m,qcm_jhy_sample_r_ord r "
  1296. +" where t.smp_no = m.smp_no and t.smp_no = r.smp_no and t.freq_code <> 'D' and t.smp_type_code = '0' "
  1297. +" and t.status = '0' and r.std_code not like '%ASTM%' and r.std_code not like '%ASME%' "
  1298. +" and r.Cert_Inst_Code in ('5000', 'IC010', 'IC003', 'IC004', 'IC001') and m.SMP_CATG = 'B' "
  1299. +" and r.Delivery_State_Desc in ('TMCP','AR','CR') and r.design_key not like '19%' "
  1300. +" and t.batch_no = '"+BATCH_NO+"' "
  1301. +" and r.thick = '"+THICK+"' "
  1302. +" and t.SPECIMEN_NO != '"+SPECIMEN_NO+"' "
  1303. +"order by r.STEEL_CODE) t where t.qcmSpecflag in ('1', '0') ";
  1304. //获取能合并的委托
  1305. List<HashMap> list= mapper.query(sql1.toString());
  1306. if(list!=null && list.size()>=1){
  1307. String sql2 = " select * from qcm_jhy_sample_consign_d_item i where i.PHY_CODE_L = 'HC' "
  1308. +" and i.specimen_no ='"+SPECIMEN_NO+"' and i.seq <=49 ";
  1309. //获取挪威冲击
  1310. List<HashMap> list2= mapper.query(sql2.toString());
  1311. //循环其它委托
  1312. for (int i = 0; i < list.size(); i++) {
  1313. String sql3 = " select * from qcm_jhy_sample_consign_d_item i where i.PHY_CODE_L = 'HC' "
  1314. +" and i.specimen_no ='"+list.get(i).get("SPECIMEN_NO")+"' and i.seq <=49 ";
  1315. //获取其它委托的冲击
  1316. List<HashMap> list3= mapper.query(sql3.toString());
  1317. if(list3!=null && list3.size()>=1){
  1318. for (HashMap hashMap : list3) {
  1319. String itemCodeT = (String) hashMap.get("ITEM_CODE_T");//试验温度代码
  1320. for (HashMap hashMap1 : list2) {//挪威
  1321. String itemCodeT1 = (String) hashMap1.get("ITEM_CODE_T");//试验温度代码
  1322. //判断冲击温度是否一样
  1323. if(!itemCodeT.equals(itemCodeT1)){
  1324. cro.setV_errCode(-1);
  1325. cro.setV_errMsg(BATCH_NO+"轧批中有挪威认证机构,技术中心规定挪威委托项目中冲击温度不一样不能合并引用,请单独下发委托,谢谢!");
  1326. return cro;
  1327. }
  1328. }
  1329. }
  1330. }
  1331. }
  1332. }
  1333. }
  1334. }catch(Exception ex){
  1335. cro.setV_errCode(-1);
  1336. cro.setV_errMsg("挪威冲击比较出错"+ex.getMessage());
  1337. SqlSession.rollback();
  1338. }finally {
  1339. SqlSession.close();
  1340. }
  1341. cro.setV_errCode(0);
  1342. return cro;
  1343. }
  1344. }