/** * */ package xin.glue.ui.B.B02; import java.util.ArrayList; import java.util.List; import java.util.Map; import com.posdata.glue.biz.activity.PosActivity; import com.posdata.glue.context.PosContext; import com.posdata.glue.dao.vo.PosParameter; import com.posdata.glue.dao.vo.PosRow; import com.posdata.glue.dao.vo.PosRowSet; /** * 类名 FindCret.java * 说明 description of the class * 创建日期 2008-12-4 * 作者 hewenxi */ public class FindCret extends PosActivity{ public String runActivity(PosContext context) { String[] cret; PosParameter param = null; PosRowSet coilResult = null; PosRowSet chemCdInfoResult = null; PosRowSet qltyCdInfoResult = null; PosRow coilRow = null; PosRow chemRow = null; PosRow qltyRow = null; List list = null; Map map = null; cret = (String[])context.get("cret"); param = new PosParameter(); param.setWhereClauseParameter(0, cret[0]); coilResult = this.getDao("mesdao").find("UIB021100_05.SELECT", param); chemCdInfoResult = this.getDao("mesdao").find("UIB021100_04.SELECT", param); qltyCdInfoResult = this.getDao("mesdao").find("UIB021100_07.SELECT", param); list = new ArrayList(); while(coilResult.hasNext()) { coilRow = coilResult.next(); map = coilRow.getAttributes(); String COIL_NO = (String)coilRow.getAttribute("COIL_NO"); while(chemCdInfoResult.hasNext()) { chemRow = chemCdInfoResult.next(); String COIL_NO_CHEM = (String)chemRow.getAttribute("COIL_NO"); String CHEM_CD = ""; String CHEM_VAL = ""; if(COIL_NO.equals(COIL_NO_CHEM)) { if(null != chemRow.getAttribute("CHEM_CD")){ CHEM_CD = (String)chemRow.getAttribute("CHEM_CD"); } if(null != chemRow.getAttribute("CHEM_VAL")){ CHEM_VAL = chemRow.getAttribute("CHEM_VAL").toString(); } map.put(CHEM_CD, CHEM_VAL); } } while(qltyCdInfoResult.hasNext()) { qltyRow = qltyCdInfoResult.next(); String COIL_NO_QLTY = (String)qltyRow.getAttribute("COIL_NO"); if(COIL_NO.equals(COIL_NO_QLTY)) { String QLTY_CD = (String)qltyRow.getAttribute("QLTY_CD"); String SMP_CUT_LOC = (String)qltyRow.getAttribute("SMP_CUT_LOC"); String QLTY_VAL_WK = ""; String QLTY_TYPE_WK = ""; if(qltyRow.getAttribute("QLTY_VAL_WK") != null){ QLTY_VAL_WK = qltyRow.getAttribute("QLTY_VAL_WK").toString(); } if(qltyRow.getAttribute("QLTY_TYPE_WK") != null){ QLTY_TYPE_WK = qltyRow.getAttribute("QLTY_TYPE_WK").toString(); } if(SMP_CUT_LOC.equals("1")||SMP_CUT_LOC.equals("2")) { map.put(QLTY_CD+"VAL"+SMP_CUT_LOC, QLTY_VAL_WK); map.put(QLTY_CD+"TYPE"+SMP_CUT_LOC, QLTY_TYPE_WK); } else { map.put(QLTY_CD+"VAL", QLTY_VAL_WK); map.put(QLTY_CD+"TYPE", QLTY_TYPE_WK); } } } chemCdInfoResult.reset(); qltyCdInfoResult.reset(); list.add(map); } context.put("DetailsResult", list); return "success"; } }