package xin.glue.ui.B.B01; import com.posdata.glue.biz.activity.PosActivity; import com.posdata.glue.biz.constants.PosBizControlConstants; 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; public class SaveFacIngr extends PosActivity { public String runActivity(PosContext context) { String[] no = (String[])context.get("no"); String[] seq = (String[])context.get("seq"); String[] fac = (String[])context.get("fac"); String[] ord = (String[])context.get("ord"); PosParameter param = new PosParameter(); param.setWhereClauseParameter(0, fac[0]); PosRowSet rowset = getDao("mesdao").find("UIB015020_08.SELECT", param); param = new PosParameter(); param.setWhereClauseParameter(0, no[0]); param.setWhereClauseParameter(1, seq[0]); getDao("mesdao").delete("UIB015020_09.DELETE", param); param = new PosParameter(); param.setWhereClauseParameter(0, fac[0]); param.setWhereClauseParameter(1, no[0]); param.setWhereClauseParameter(2, seq[0]); getDao("mesdao").update("UIB015020_10.UPDATE", param); PosRow row = null; while(rowset.hasNext()){ row = rowset.next(); param = new PosParameter(); param.setValueParamter(0, no[0]); param.setValueParamter(1, seq[0]); if(row.getAttribute("chem_cd") == null) { param.setValueParamter(2,""); } else { param.setValueParamter(2,row.getAttribute("chem_cd").toString()); } if(row.getAttribute("chem_aim") == null) { param.setValueParamter(3,""); } else { param.setValueParamter(3,row.getAttribute("chem_aim").toString()); } if(row.getAttribute("chem_min") == null) { param.setValueParamter(4,""); } else { param.setValueParamter(4,row.getAttribute("chem_min").toString()); } if(row.getAttribute("chem_max") == null) { param.setValueParamter(5,""); } else { param.setValueParamter(5,row.getAttribute("chem_max").toString()); } getDao("mesdao").insert("UIB015020_11.INSERT", param); } return PosBizControlConstants.SUCCESS; } }