021910c95468223ea527b344574380ed40e86781.svn-base 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. package QCM.JHY01.JHY0101;
  2. import java.math.BigDecimal;
  3. import java.sql.ResultSet;
  4. import java.util.Date;
  5. import java.util.HashMap;
  6. import java.util.List;
  7. import java.util.TreeSet;
  8. import java.util.UUID;
  9. import org.apache.ibatis.session.SqlSession;
  10. import org.apache.log4j.Logger;
  11. import com.alibaba.fastjson.JSONArray;
  12. import com.alibaba.fastjson.JSONObject;
  13. import CoreFS.SA01.CoreIComponent;
  14. import QCM.JHY01.VO.JhySampleDItemModel;
  15. import QCM.JHY01.VO.JhySampleDModel;
  16. public class DuplicateSample extends CoreIComponent{
  17. SqlSession SqlSession = QCM.COMMUNAL.SqlSessionBuilder.openSqlSession();
  18. QCM.COMMUNAL.OrderSqMapper mapper = SqlSession.getMapper(QCM.COMMUNAL.OrderSqMapper.class);
  19. Logger logger = Logger.getLogger(this.getClass().getName());
  20. public synchronized String doDuplicateSample(JSONArray list){
  21. logger.info("复样:==========复样"+list.toString());
  22. String msg = checkInfo(list);
  23. if (!"".equals(msg)) {
  24. return msg;
  25. }
  26. try{
  27. createQltySample(list);
  28. createChemSample(list);
  29. SqlSession.commit();
  30. }catch (Exception e) {
  31. // TODO: handle exception
  32. e.printStackTrace();
  33. SqlSession.rollback();
  34. }finally {
  35. SqlSession.close();
  36. }
  37. if ("".equals(msg)) {
  38. return "1";
  39. }else{
  40. return "生成失败!";
  41. }
  42. }
  43. private void createChemSample(JSONArray lists) {
  44. // TODO Auto-generated method stub
  45. StringBuffer sqlucomm = new StringBuffer();
  46. for (Object li : lists) {
  47. JSONObject list =(JSONObject) li;
  48. //判断是否存在材质
  49. if (!"1".equals(list.getString("IS_CHEM"))) {
  50. continue;
  51. }
  52. sqlucomm.setLength(0);
  53. sqlucomm.append("t.smp_no,t.specimen_no,t.heat_no,t.batch_no,t.inspection_lot,t.freq_code,t.freq_name,");
  54. sqlucomm.append("t.material_no,t.smp_type_code,t.smp_type_name,t.consign_no,t.consign_no_seq,t.test_qty,");
  55. sqlucomm.append("t.smp_qty,t.smp_location,t.board_no,t.quote_consign_no,t.old_consign_no,t.pline_code,");
  56. sqlucomm.append("t.pline_name,t.status,t.validflag,t.source,t.guid,t.send_id,t.send_name,t.send_time,");
  57. sqlucomm.append(" t.chem_item,t.product_cnt,t.create_time,t.smp_location_code from QCM_JHY_SAMPLE_CONSIGN_D t inner join "
  58. + "QCM_JUDGE_CHEMICAL c on t.smp_no=c.smp_no and t.smp_no='"+list.getString("QLTY_SMP_NO")+"' and c.cic_result_code='2'");
  59. List<HashMap> results=mapper.query(sqlucomm.toString());
  60. if (results==null || results.size()<1) {
  61. continue;
  62. }
  63. String specimen_no = "";
  64. for (HashMap result : results) {
  65. for (int i = 0; i < 2; i++) {
  66. //生成新的复样的取样编号
  67. specimen_no = createSpecimen_no((String)result.get("SMP_NO"));
  68. JhySampleDModel model=getSampleD(specimen_no,result);
  69. mapper.insertSampleD(model);
  70. }
  71. }
  72. }
  73. }
  74. private JhySampleDModel getSampleD(String specimen_no, HashMap result) {
  75. // TODO Auto-generated method stub
  76. JhySampleDModel model=new JhySampleDModel();
  77. model.setSmp_no((String)result.get("SMP_NO"));
  78. model.setSpecimen_no(specimen_no);
  79. model.setHeat_no((String)result.get("HEAT_NO"));
  80. model.setBatch_no((String)result.get("BATCH_NO"));
  81. model.setBoard_no((String)result.get("BOARD_NO"));
  82. model.setInspection_lot((String)result.get("INSPECTION_LOT"));
  83. model.setMaterial_no((String)result.get("MATERIAL_NO"));
  84. model.setFreq_code((String)result.get("FREQ_CODE"));
  85. model.setFreq_name((String)result.get("FREQ_NAME"));
  86. //试验次数
  87. model.setTest_qty((BigDecimal)result.get("TEST_QTY"));
  88. model.setSmp_qty((BigDecimal)result.get("SMP_QTY"));;
  89. //样品类型
  90. model.setSmp_type_code("1");
  91. model.setSmp_type_name("复样");
  92. model.setSmp_location((String)result.get("SMP_LOCATION"));
  93. //初样取样编号(复样不能为空)
  94. model.setOld_consign_no((String)result.get("SPECIMEN_NO"));
  95. model.setPline_code((String)result.get("PLINE_CODE"));
  96. model.setPline_name((String)result.get("PLINE_NAME"));
  97. model.setValidflag("1");
  98. model.setStatus("0");
  99. model.setSource("0");
  100. model.setProduct_cnt((BigDecimal)result.get("PRODUCT_CNT"));
  101. model.setChem_item((String)result.get("CHEM_ITEM"));
  102. model.setGuid(this.getUUID());
  103. return model;
  104. }
  105. private void createQltySample(JSONArray lists) throws Exception {
  106. // TODO Auto-generated method stub
  107. StringBuffer sqlucomm = new StringBuffer();
  108. for (Object li : lists) {
  109. JSONObject list =(JSONObject) li;
  110. //判断是否存在材质
  111. if (!"1".equals(list.getString("IS_QTLY"))) {
  112. continue;
  113. }
  114. sqlucomm.setLength(0);
  115. //查询试样号向下的检验结果
  116. sqlucomm.append("select r.*,d.FREQ_CODE,d.freq_name,d.test_qty,d.smp_qty,d.board_no,d.smp_location,d.pline_code,d.pline_name,d.product_cnt,d.smp_location_code "
  117. + " from QCM_JUDGE_PHYSICAL_RESULT r left join QCM_JHY_SAMPLE_CONSIGN_D d on r.smp_no=d.smp_no and r.specimen_no=d.specimen_no "
  118. + " where r.smp_no='"+list.getString("QLTY_SMP_NO")+"' and r.IS_PASS='1'");
  119. List<HashMap> results=mapper.query(sqlucomm.toString());
  120. if (results==null || results.size()<1) {
  121. continue;
  122. }
  123. for (HashMap result : results) {
  124. //查询试样号对应的合同信息
  125. sqlucomm.setLength(0);
  126. sqlucomm.append("SELECT DESIGN_KEY,PSC,SMP_TYPE_CODE,CERT_INST_CODE FROM QCM_JHY_SAMPLE_R_ORD WHERE SMP_NO='"+result.get("SMP_NO")+"'");
  127. List<HashMap> resultsM=mapper.query(sqlucomm.toString());
  128. if (resultsM==null || resultsM.size()<1) {
  129. continue;
  130. }
  131. //根据合同信息和项目找到复样倍数信息
  132. HashMap sampleM=resultsM.get(0);
  133. if ("HA".equals(((String)result.get("PHY_CODE_L")))) {
  134. sqlucomm.setLength(0);
  135. sqlucomm.append("SELECT * FROM QCM_ORD_DESIGN_SAMPLE_M WHERE DESIGN_KEY='"+sampleM.get("DESIGN_KEY")+"'"
  136. + " and PSC='"+sampleM.get("PSC")+"' and SAMPLE_STYLE_CODE='"+sampleM.get("SMP_TYPE_CODE")+"' and ORG_CODE='"+sampleM.get("CERT_INST_CODE")+"' "
  137. + " and RATE_CODE='"+result.get("FREQ_CODE")+"' and PHY_CODE_L='HA' ");
  138. // sqlucomm.append("SELECT * FROM QCM_ORD_DESIGN_SAMPLE_M WHERE DESIGN_KEY='"+sampleM.get("DESIGN_KEY")+"'"
  139. // + " and PSC='"+sampleM.get("PSC")+"' and SAMPLE_STYLE_CODE='"+sampleM.get("SMP_TYPE_CODE")+"' and ORG_CODE='"+sampleM.get("CERT_INST_CODE")+"' "
  140. // + "and PHY_CODE_L='"+result.get("PHY_CODE_L")+"' and RATE_CODE='"+result.get("FREQ_CODE")+"' and PHY_CODE_L='HA' "
  141. // + "and SMP_POSITION_CODE='"+result.get("SMP_POSITION_CODE")+"'");
  142. }else if("HJ".equals(((String)result.get("PHY_CODE_L")))){
  143. sqlucomm.setLength(0);
  144. sqlucomm.append("SELECT * FROM QCM_ORD_DESIGN_SAMPLE_M WHERE DESIGN_KEY='"+sampleM.get("DESIGN_KEY")+"'"
  145. + " and PSC='"+sampleM.get("PSC")+"' and SAMPLE_STYLE_CODE='"+sampleM.get("SMP_TYPE_CODE")+"' and ORG_CODE='"+sampleM.get("CERT_INST_CODE")+"' "
  146. + " and RATE_CODE='"+result.get("FREQ_CODE")+"' and PHY_CODE_L='HJ' ");
  147. }else{
  148. sqlucomm.setLength(0);
  149. sqlucomm.append("SELECT * FROM QCM_ORD_DESIGN_SAMPLE_M WHERE DESIGN_KEY='"+sampleM.get("DESIGN_KEY")+"'"
  150. + " and PSC='"+sampleM.get("PSC")+"' and SAMPLE_STYLE_CODE='"+sampleM.get("SMP_TYPE_CODE")+"' and ORG_CODE='"+sampleM.get("CERT_INST_CODE")+"' "
  151. + "and PHY_CODE_L='"+result.get("PHY_CODE_L")+"' and PHY_CODE_M='"+result.get("PHY_CODE_M")+"' "
  152. + " and PHY_CODE_S='"+result.get("PHY_CODE_S")+"'");
  153. // sqlucomm.append("SELECT * FROM QCM_ORD_DESIGN_SAMPLE_M WHERE DESIGN_KEY='"+sampleM.get("DESIGN_KEY")+"'"
  154. // + " and PSC='"+sampleM.get("PSC")+"' and SAMPLE_STYLE_CODE='"+sampleM.get("SMP_TYPE_CODE")+"' and ORG_CODE='"+sampleM.get("CERT_INST_CODE")+"' "
  155. // + "and PHY_CODE_L='"+result.get("PHY_CODE_L")+"' and PHY_CODE_M='"+result.get("PHY_CODE_M")+"' and SMP_POSITION_CODE='"+result.get("SMP_POSITION_CODE")+"'"
  156. // + " and PHY_CODE_S='"+result.get("PHY_CODE_S")+"'");
  157. if (result.get("ITEM_CODE_D")!=null) {
  158. sqlucomm.append(" and ITEM_CODE_D='"+result.get("ITEM_CODE_D")+"'");
  159. }
  160. if (result.get("ITEM_CODE_T")!=null) {
  161. sqlucomm.append( " and ITEM_CODE_T='"+result.get("ITEM_CODE_T")+"'");
  162. }
  163. if (result.get("ITEM_CODE_S")!=null) {
  164. sqlucomm.append(" and ITEM_CODE_S='"+result.get("ITEM_CODE_S")+"'");
  165. }
  166. }
  167. List<HashMap> qtlyResource=mapper.query(sqlucomm.toString());
  168. int time=1;
  169. if (qtlyResource==null || qtlyResource.size()<1){
  170. continue;
  171. }
  172. for (int j = 0; j < qtlyResource.size(); j++) {
  173. HashMap resource=qtlyResource.get(j);
  174. if (null!=resource.get("RETEST_QTY")) {
  175. time=((BigDecimal)resource.get("RETEST_QTY")).intValue();
  176. }
  177. //查询当前频率是否存在已经存在的取样要求信息
  178. sqlucomm.setLength(0);
  179. sqlucomm.append("SELECT SPECIMEN_NO FROM QCM_JHY_SAMPLE_CONSIGN_D WHERE SMP_NO='"+result.get("SMP_NO")+"' "
  180. +" AND SMP_TYPE_CODE='1' AND FREQ_CODE='"+resource.get("RATE_CODE")+"' and STATUS='0' ");
  181. // sqlucomm.append("SELECT SPECIMEN_NO FROM QCM_JHY_SAMPLE_CONSIGN_D WHERE SMP_NO='"+result.get("SMP_NO")+"' "
  182. // +" AND SMP_TYPE_CODE='1' AND FREQ_CODE='"+result.get("FREQ_CODE")+"' and STATUS='0' and SMP_LOCATION_CODE='"+result.get("SMP_LOCATION_CODE")+"'");
  183. List<HashMap> resultsD=mapper.query(sqlucomm.toString());
  184. String specimen_no = "";
  185. if (resultsD==null || resultsD.size()<1) {
  186. //生成新的复样的取样编号
  187. specimen_no = createSpecimen_no((String)result.get("SMP_NO"));
  188. JhySampleDModel model=getSampleD(specimen_no,result);
  189. mapper.insertSampleD(model);
  190. //生成复样的项目信息
  191. for (int i = 0; i < time; i++) {
  192. JhySampleDItemModel item=getSampleItem((String)result.get("SMP_NO"),specimen_no,resource);
  193. mapper.insertSampleItem(item);
  194. }
  195. continue;
  196. }
  197. //判断是否已经存在该项目,避免复样在取复样情况
  198. specimen_no=(String)resultsD.get(0).get("SPECIMEN_NO");
  199. sqlucomm.setLength(0);
  200. sqlucomm.append("SELECT * FROM QCM_JHY_SAMPLE_CONSIGN_D_ITEM WHERE SPECIMEN_NO='"+specimen_no+"'"
  201. + " and SMP_NO='"+result.get("SMP_NO")+"' "
  202. + "and PHY_CODE_L='"+resource.get("PHY_CODE_L")+"' and PHY_CODE_M='"+resource.get("PHY_CODE_M")+"'"
  203. + " and PHY_CODE_S='"+resource.get("PHY_CODE_S")+"'");
  204. if (result.get("ITEM_CODE_D")!=null) {
  205. sqlucomm.append(" and ITEM_CODE_D='"+resource.get("ITEM_CODE_D")+"'");
  206. }
  207. if (result.get("ITEM_CODE_T")!=null) {
  208. sqlucomm.append( " and ITEM_CODE_T='"+resource.get("ITEM_CODE_T")+"'");
  209. }
  210. if (result.get("ITEM_CODE_S")!=null) {
  211. sqlucomm.append(" and ITEM_CODE_S='"+resource.get("ITEM_CODE_S")+"'");
  212. }
  213. List<HashMap> resultsI=mapper.query(sqlucomm.toString());
  214. if (resultsI==null || resultsI.size()<1) {
  215. for (int i = 0; i < time; i++) {
  216. JhySampleDItemModel item=getSampleItem((String)result.get("SMP_NO"),specimen_no,resource);
  217. mapper.insertSampleItem(item);
  218. }
  219. }
  220. }
  221. }
  222. //更新合同表改为待判
  223. sqlucomm.setLength(0);
  224. sqlucomm.append("update QCM_JHY_SAMPLE_R_ORD t set t.judge_status='0',t.judge_result_code=null,t.judge_result_desc=null,");
  225. sqlucomm.append("t.judge_time=null,t.cic_id=null,t.phy_id=null,t.judge_name=null,t.judge_memo=null where t.smp_no='"+list.getString("QLTY_SMP_NO")+"'");
  226. mapper.updateJudgeStatus(sqlucomm.toString());
  227. }
  228. }
  229. private JhySampleDItemModel getSampleItem(String smp_no, String specimen_no, HashMap resource) throws Exception {
  230. // TODO Auto-generated method stub
  231. JhySampleDItemModel model=new JhySampleDItemModel();
  232. model.setSmp_no(smp_no);
  233. model.setSpecimen_no(specimen_no);
  234. model.setPhy_code_l((String)resource.get("PHY_CODE_L"));;
  235. model.setPhy_code_m((String)resource.get("PHY_CODE_M"));
  236. model.setPhy_code_s((String)resource.get("PHY_CODE_S"));
  237. model.setPhy_name_l((String)resource.get("PHY_NAME_L"));
  238. model.setPhy_name_m((String)resource.get("PHY_NAME_M"));
  239. model.setPhy_name_s((String)resource.get("PHY_NAME_S"));
  240. model.setItem_code_d((String)resource.get("ITEM_CODE_D"));
  241. model.setItem_code_t((String)resource.get("ITEM_CODE_T"));
  242. model.setItem_code_s((String)resource.get("ITEM_CODE_S"));
  243. model.setItem_code_l((String)resource.get("ITEM_CODE_L"));
  244. model.setItem_name_d((String)resource.get("ITEM_NAME_D"));
  245. model.setItem_name_t((String)resource.get("ITEM_NAME_T"));
  246. model.setItem_name_s((String)resource.get("ITEM_NAME_S"));
  247. model.setItem_desc_l((String)resource.get("ITEM_DESC_L"));
  248. model.setIsjudge((String)resource.get("ISJUDGE"));
  249. model.setPhy_unit((String)resource.get("PHY_UNIT"));
  250. model.setGroup_seq((String)resource.get("GROUP_SEQ"));
  251. model.setSpecl_fl((String)resource.get("SPECL_FL"));
  252. //试验次数
  253. model.setTest_qty((BigDecimal)resource.get("SMP_COUNT"));
  254. model.setSmp_qty((BigDecimal)resource.get("SMP_QTY"));
  255. model.setCreate_id((String)resource.get("CREATE_ID"));
  256. model.setCreate_name((String)resource.get("CREATE_NAME"));
  257. model.setCreate_time(new Date());
  258. model.setSeq(createItemSeq(smp_no,specimen_no));
  259. //样品类型
  260. return model;
  261. }
  262. /**
  263. * 创建项目seq
  264. * @param specimen_no
  265. * @param smp_no
  266. * @param cn
  267. * @return
  268. * @throws Exception
  269. */
  270. private Integer createItemSeq(String smp_no, String specimen_no) throws Exception {
  271. // TODO Auto-generated method stub
  272. StringBuffer sqlucomm = new StringBuffer();
  273. sqlucomm.append("SELECT max(SEQ) SEQ FROM QCM_JHY_SAMPLE_CONSIGN_D_ITEM WHERE SMP_NO ='"+smp_no+"' and SPECIMEN_NO='"+specimen_no+"'");
  274. HashMap result=mapper.queryOne(sqlucomm.toString());
  275. Integer SEQ=0;
  276. if (result!=null && result.get("SEQ")!=null) {
  277. SEQ=((BigDecimal)result.get("SEQ")).intValue();
  278. }
  279. SEQ++;
  280. return SEQ;
  281. }
  282. /**
  283. * 生成不带 "-" 的UUID
  284. *
  285. * @return
  286. */
  287. private String getUUID() {
  288. UUID uuid = UUID.randomUUID();
  289. String str = uuid.toString();
  290. String uuidStr = str.replace("-", "");
  291. return uuidStr;
  292. }
  293. /**
  294. * 获取取样编号
  295. * @param smp_no
  296. * @return
  297. */
  298. private String createSpecimen_no(String smp_no) {
  299. // TODO Auto-generated method stub
  300. String specimen_no="";
  301. StringBuffer sqlucomm = new StringBuffer();
  302. sqlucomm.append("SELECT max(to_number(substr(SPECIMEN_NO,13))) SPECIMEN_NO FROM QCM_JHY_SAMPLE_CONSIGN_D "
  303. + "WHERE SPECIMEN_NO like '"+smp_no+"%' and SMP_NO='"+smp_no+"'");
  304. HashMap result=mapper.queryOne(sqlucomm.toString());
  305. BigDecimal seq=BigDecimal.ZERO;
  306. if (result!=null && result.get("SPECIMEN_NO") !=null) {
  307. seq=(BigDecimal)result.get("SPECIMEN_NO");
  308. }
  309. seq=seq.add(BigDecimal.ONE);
  310. specimen_no=smp_no+ String.format("%02d", seq.intValue());
  311. return specimen_no;
  312. }
  313. private String checkInfo(JSONArray lists) {
  314. // TODO Auto-generated method stub
  315. String msg = "";
  316. if (lists == null || lists.size() < 1) {
  317. return "未寻到或无可生成检验委托的数据";
  318. }
  319. String inspection_lot = "";
  320. TreeSet<String> treeSet = new TreeSet<String>();
  321. ResultSet rs = null;
  322. for (Object list : lists) {
  323. JSONObject map = (JSONObject) list;
  324. // 检验号
  325. msg = checkField("INSPECTION_LOT", "检验号", map);
  326. if (!"".equals(msg)) {
  327. return msg;
  328. }
  329. // 获取共同检验号
  330. inspection_lot = map.getString("INSPECTION_LOT");
  331. treeSet.add(inspection_lot);
  332. // DESIGN_KEY
  333. msg = checkField("DESIGN_KEY", "DESIGN_KEY", map);
  334. if (!"".equals(msg)) {
  335. return msg;
  336. }
  337. // 炉号
  338. msg = checkField("HEAT_NO", "炉号", map);
  339. if (!"".equals(msg)) {
  340. return msg;
  341. }
  342. // 轧批号
  343. msg = checkField("BATCH_NO", "轧批号", map);
  344. if (!"".equals(msg)) {
  345. return msg;
  346. }
  347. // 全程产线号
  348. msg = checkField("MSC_PLINE", "全程产线号", map);
  349. if (!"".equals(msg)) {
  350. return msg;
  351. }
  352. // 全程产线代码
  353. msg = checkField("PLINE_CODE", "产线代码", map);
  354. if (!"".equals(msg)) {
  355. return msg;
  356. }
  357. // 全程产线名称
  358. msg = checkField("PLINE_NAME", "产线名称", map);
  359. if (!"".equals(msg)) {
  360. return msg;
  361. }
  362. // //交货状态
  363. // msg=checkField("DELIVERY_STATE_CODE","交货状态代码",map);
  364. // if (!"".equals(msg)) {
  365. // return msg;
  366. // }
  367. // //交货状态
  368. // msg=checkField("DELIVERY_STATE_DESC","交货状态",map);
  369. // if (!"".equals(msg)) {
  370. // return msg;
  371. // }
  372. // 工序代码
  373. // msg=checkField("PROCESS_CODE","工序代码",map);
  374. // if (!"".equals(msg)) {
  375. // return msg;
  376. // }
  377. // 厚款长
  378. msg = checkField("THICK", "厚度", map);
  379. if (!"".equals(msg)) {
  380. return msg;
  381. }
  382. /*
  383. * msg=checkField("WIDTH","宽度",map); if (!"".equals(msg)) { return
  384. * msg; } msg=checkField("LENGTH","长度",map); if (!"".equals(msg)) {
  385. * return msg; }
  386. */
  387. msg = checkField("PSC", "产品码", map);
  388. if (!"".equals(msg)) {
  389. return msg;
  390. }
  391. msg = checkField("QLTY_SMP_NO", "原试样号", map);
  392. if (!"".equals(msg)) {
  393. return msg;
  394. }
  395. }
  396. if (treeSet.size() != 1) {
  397. return "检验号不一致";
  398. }
  399. return msg;
  400. }
  401. /**
  402. * 验证字段
  403. *
  404. * @param field
  405. * 字段
  406. * @param name
  407. * 字段名
  408. * @param map
  409. * map对象
  410. * @return
  411. */
  412. private String checkField(String field, String name, JSONObject map) {
  413. if (map.get(field) == null) {
  414. return name + "不存在";
  415. }
  416. String ran = (String) map.get(field);
  417. if (ran == null || "".equals(ran.trim())) {
  418. return name + "为空";
  419. }
  420. return "";
  421. }
  422. }