package xin.glue.ui.B.B01; import xin.glue.ui.B.common.SaveModifyHistory; 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.PosGenericDao; import com.posdata.glue.dao.vo.PosParameter; import com.posdata.glue.dao.vo.PosRowSet; /** * DesignKey(ID:UBI010320) * @author {meiguiping} * @date 2008-10-23 */ public class SaveDesignKey extends PosActivity { private PosGenericDao dao = this.getDao("mesdao"); public String runActivity(PosContext context) { String INFID = "UIB010320"; String[] PRDNM_CD = (String[])context.get("PRDNM_CD");// String[] SPEC_ABBSYM = (String[])context.get("SPEC_ABBSYM");// String[] THK_MIN = (String[])context.get("THK_MIN");// String[] THK_MAX = (String[])context.get("THK_MAX");// String[] WTH_MIN = (String[])context.get("WTH_MIN");// String[] WTH_MAX = (String[])context.get("WTH_MAX"); String[] ORD_USE_TP = (String[])context.get("ORD_USE_TP");// String[] SPEC_STL_GRD = (String[])context.get("SPEC_STL_GRD");// // String[] CUST_SPEC_NO = (String[])context.get("CUST_SPEC_NO");// String[] FAC_STL_GRD = (String[])context.get("FAC_STL_GRD"); String[] SMS_STD_NO = (String[])context.get("SMS_STD_NO"); String[] MILL_STD_NO = (String[])context.get("MILL_STD_NO"); String[] PROD_LINE = (String[])context.get("PROD_LINE");//产线 String[] COLD_STD_NO = (String[])context.get("COLD_STD_NO");// String[] C_PRDNM_CD = (String[])context.get("C_PRDNM_CD"); String[] C_SPEC_ABBSYM= (String[])context.get("C_SPEC_ABBSYM"); String[] C_SPEC_STL_GRD= (String[])context.get("C_SPEC_STL_GRD"); String[] C_ORD_USE_TP = (String[])context.get("C_ORD_USE_TP"); String[] AUTO_PROCESS_TP = (String[])context.get("AUTO_PROCESS_TP");// String[] REG_NM = (String[])context.get("REG_NM");//修改人 String[] PROD_LINE1 = (String[])context.get("PROD_LINE1");//产线 String[] PRDNM_CD1 = (String[])context.get("PRDNM_CD1");// String[] SPEC_ABBSYM1 = (String[])context.get("SPEC_ABBSYM1");// String[] THK_MIN1 = (String[])context.get("THK_MIN1");// String[] THK_MAX1 = (String[])context.get("THK_MAX1");// String[] WTH_MIN1 = (String[])context.get("WTH_MIN1");// String[] WTH_MAX1 = (String[])context.get("WTH_MAX1");// String[] ORD_USE_TP1 = (String[])context.get("ORD_USE_TP1");// String[] SPEC_STL_GRD1= (String[])context.get("SPEC_STL_GRD1");// // String[] CUST_SPEC_NO1= (String[])context.get("CUST_SPEC_NO1");// String[] SIZE_SPEC_CD = (String[])context.get("SIZE_SPEC_CD"); String[] rowStuts = (String[])context.get("rowStuts"); String[] CHK = (String[])context.get("CHK"); PosParameter param = null; if(rowStuts != null) { int j = 0; int len = rowStuts.length; for(int i=0; i < len; i++) { j = 0; param = new PosParameter(); if("i".equals(rowStuts[i]) && "Y".equals(CHK[i])) { param.setValueParamter(j++, PROD_LINE[i]); param.setValueParamter(j++, PRDNM_CD[i]); param.setValueParamter(j++, SPEC_ABBSYM[i]); param.setValueParamter(j++, THK_MIN[i]); param.setValueParamter(j++, THK_MAX[i]); param.setValueParamter(j++, WTH_MIN[i]); param.setValueParamter(j++, WTH_MAX[i]); param.setValueParamter(j++, ORD_USE_TP[i]); param.setValueParamter(j++, SPEC_STL_GRD[i]); // param.setValueParamter(j++, CUST_SPEC_NO[i]); param.setValueParamter(j++, "C".equals(PROD_LINE[i])?"*": FAC_STL_GRD[i]); param.setValueParamter(j++, "C".equals(PROD_LINE[i])?"*": SMS_STD_NO[i]); param.setValueParamter(j++, "C".equals(PROD_LINE[i])?"*": MILL_STD_NO[i]); param.setValueParamter(j++, REG_NM[0]); // param.setValueParamter(j++, AUTO_PROCESS_TP[i]); param.setValueParamter(j++, "H".equals(PROD_LINE[i])?"*": C_PRDNM_CD[i]); param.setValueParamter(j++, "H".equals(PROD_LINE[i])?"*": C_SPEC_ABBSYM[i]); param.setValueParamter(j++, "H".equals(PROD_LINE[i])?"*": C_SPEC_STL_GRD[i]); param.setValueParamter(j++, "H".equals(PROD_LINE[i])?"*": C_ORD_USE_TP[i]); param.setValueParamter(j++, "H".equals(PROD_LINE[i])?"*": COLD_STD_NO[i]); param.setValueParamter(j++, "H".equals(PROD_LINE[i])?"*": SIZE_SPEC_CD[i]); dao.insert("UIB010320_01.INSERT", param); SaveModifyHistory.writeLog(dao, INFID, "I", "UIB010320_01.INSERT", param.getValueParameters(), "", REG_NM[0]); } else if("u".equals(rowStuts[i]) && "Y".equals(CHK[i])) { param.setWhereClauseParameter(j++, PROD_LINE[i]); param.setWhereClauseParameter(j++, PRDNM_CD[i]); param.setWhereClauseParameter(j++, SPEC_ABBSYM[i]); param.setWhereClauseParameter(j++, THK_MIN[i]); param.setWhereClauseParameter(j++, THK_MAX[i]); param.setWhereClauseParameter(j++, WTH_MIN[i]); param.setWhereClauseParameter(j++, WTH_MAX[i]); param.setWhereClauseParameter(j++, ORD_USE_TP[i]); param.setWhereClauseParameter(j++, SPEC_STL_GRD[i]); // param.setWhereClauseParameter(j++, CUST_SPEC_NO[i]); param.setWhereClauseParameter(j++, "C".equals(PROD_LINE[i])?"*": FAC_STL_GRD[i]); param.setWhereClauseParameter(j++, "C".equals(PROD_LINE[i])?"*": SMS_STD_NO[i]); param.setWhereClauseParameter(j++, "C".equals(PROD_LINE[i])?"*": MILL_STD_NO[i]); param.setWhereClauseParameter(j++, REG_NM[0]);// param.setWhereClauseParameter(j++, "H".equals(PROD_LINE[i])?"*": C_PRDNM_CD[i]); param.setWhereClauseParameter(j++, "H".equals(PROD_LINE[i])?"*": C_SPEC_ABBSYM[i]); param.setWhereClauseParameter(j++, "H".equals(PROD_LINE[i])?"*": C_SPEC_STL_GRD[i]); param.setWhereClauseParameter(j++, "H".equals(PROD_LINE[i])?"*": C_ORD_USE_TP[i]); param.setWhereClauseParameter(j++, "H".equals(PROD_LINE[i])?"*": COLD_STD_NO[i]); param.setWhereClauseParameter(j++, "H".equals(PROD_LINE[i])?"*": SIZE_SPEC_CD[i]); // param.setWhereClauseParameter(j++, AUTO_PROCESS_TP[i]); param.setWhereClauseParameter(j++, PROD_LINE1[i]); param.setWhereClauseParameter(j++, PRDNM_CD1[i]); param.setWhereClauseParameter(j++, SPEC_ABBSYM1[i]); param.setWhereClauseParameter(j++, THK_MIN1[i]); param.setWhereClauseParameter(j++, THK_MAX1[i]); param.setWhereClauseParameter(j++, WTH_MIN1[i]); param.setWhereClauseParameter(j++, WTH_MAX1[i]); param.setWhereClauseParameter(j++, ORD_USE_TP1[i]); param.setWhereClauseParameter(j++, SPEC_STL_GRD1[i]); // param.setWhereClauseParameter(j++, CUST_SPEC_NO1[i]); dao.update("UIB010320_01.UPDATE", param); SaveModifyHistory.writeLog(dao, INFID, "U", "UIB010320_01.UPDATE", param.getWhereClauseParamters(), "", REG_NM[0]); } else if("d".equals(rowStuts[i]) && "Y".equals(CHK[i])) { param.setWhereClauseParameter(j++, PRDNM_CD1[i]); param.setWhereClauseParameter(j++, SPEC_ABBSYM1[i]); param.setWhereClauseParameter(j++, THK_MIN1[i]); param.setWhereClauseParameter(j++, THK_MAX1[i]); param.setWhereClauseParameter(j++, WTH_MIN1[i]); param.setWhereClauseParameter(j++, WTH_MAX1[i]); param.setWhereClauseParameter(j++, ORD_USE_TP1[i]); param.setWhereClauseParameter(j++, SPEC_STL_GRD1[i]); param.setWhereClauseParameter(j++, PROD_LINE[i]); // param.setWhereClauseParameter(j++, CUST_SPEC_NO1[i]); dao.delete("UIB010320_01.DELETE", param); SaveModifyHistory.writeLog(dao, INFID, "D", "UIB010320_01.DELETE", param.getWhereClauseParamters(), "", REG_NM[0]); } } } return PosBizControlConstants.SUCCESS; } public boolean beExist(String str , String sql) { PosParameter pa = new PosParameter(); PosRowSet rowset = null; pa.setWhereClauseParameter(0, str); rowset = dao.find(sql, pa); if(rowset.count()==0 || rowset==null) return false; else return true; } }